-
Notifications
You must be signed in to change notification settings - Fork 1k
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
NuGet: Set EnableWindowsTargeting as true #9082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love that it is such a simple fix.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs
Outdated
Show resolved
Hide resolved
This reverts commit b45ddf5.
@na1307 Could you add a test case for this to UpdateWorkerTests.SDK.cs? Something like this should work, based on code sample in #8572 [Fact]
public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceInclude_Windows()
{
// update Newtonsoft.Json from 9.0.1 to 13.0.1
await TestUpdateForProject("Newtonsoft.Json", "9.0.1", "13.0.1",
// initial
projectContents: $"""
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
</Project>
""",
// expected
expectedProjectContents: $"""
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
</Project>
""");
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @na1307!
Hi I'm deploying this |
Fixes: #8971, Fixes #8572
This prevents NETSDK1100 errors from occurring for Windows-specific apps.