diff --git a/src/NSwag.Commands/NSwag.Commands.csproj b/src/NSwag.Commands/NSwag.Commands.csproj
index 0142c8b67..c13687258 100644
--- a/src/NSwag.Commands/NSwag.Commands.csproj
+++ b/src/NSwag.Commands/NSwag.Commands.csproj
@@ -12,7 +12,7 @@
-
+
@@ -34,7 +34,6 @@
-
diff --git a/src/NSwag.Commands/RuntimeUtilities.cs b/src/NSwag.Commands/RuntimeUtilities.cs
index 0fca74c26..5b3a31266 100644
--- a/src/NSwag.Commands/RuntimeUtilities.cs
+++ b/src/NSwag.Commands/RuntimeUtilities.cs
@@ -6,10 +6,6 @@
// Rico Suter, mail@rsuter.com
//-----------------------------------------------------------------------
-#if !NETFRAMEWORK
-using Microsoft.Extensions.PlatformAbstractions;
-#endif
-
namespace NSwag.Commands
{
/// Provides runtime utilities.
@@ -23,10 +19,9 @@ public static Runtime CurrentRuntime
#if NETFRAMEWORK
return IntPtr.Size == 4 ? Runtime.WinX86 : Runtime.WinX64;
#else
- var framework = PlatformServices.Default.Application.RuntimeFramework;
- if (framework.Identifier == ".NETCoreApp")
+ if (!System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.Ordinal))
{
- if (framework.Version.Major >= 9)
+ if (Environment.Version.Major >= 9)
{
return Runtime.Net90;
}
diff --git a/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj b/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj
index 2988ad105..81568e138 100644
--- a/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj
+++ b/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj
@@ -14,12 +14,10 @@
-
-
diff --git a/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj b/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj
index e0e24bd73..7ad181179 100644
--- a/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj
+++ b/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj
@@ -7,7 +7,7 @@
-
+