Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Microsoft.Extensions.PlatformAbstractions #5058

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/NSwag.Commands/NSwag.Commands.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
Comment on lines 16 to 17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest is not always greatest, I've chosen lowest version possible.without problems to minimize effects on consumers.

</ItemGroup>
Expand All @@ -34,7 +34,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" />
<PackageReference Include="NConsole" Version="3.12.6605.26941" />
</ItemGroup>

Expand Down
9 changes: 2 additions & 7 deletions src/NSwag.Commands/RuntimeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

#if !NETFRAMEWORK
using Microsoft.Extensions.PlatformAbstractions;
#endif

namespace NSwag.Commands
{
/// <summary>Provides runtime utilities.</summary>
Expand All @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.11" />

</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="9.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
Expand Down
Loading