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

NuGet: Set EnableWindowsTargeting as true #9082

Merged
merged 6 commits into from
Feb 21, 2024
Merged

NuGet: Set EnableWindowsTargeting as true #9082

merged 6 commits into from
Feb 21, 2024

Conversation

na1307
Copy link
Contributor

@na1307 na1307 commented Feb 20, 2024

Fixes: #8971, Fixes #8572

This prevents NETSDK1100 errors from occurring for Windows-specific apps.

@na1307 na1307 requested a review from a team as a code owner February 20, 2024 08:49
@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Feb 20, 2024
Copy link
Contributor

@JoeRobich JoeRobich left a 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.

@JoeRobich
Copy link
Contributor

@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>
                """);
        }

Copy link
Contributor

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

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

Thanks @na1307!

@Nishnha
Copy link
Member

Nishnha commented Feb 21, 2024

Hi I'm deploying this

@Nishnha Nishnha merged commit 97e8329 into dependabot:main Feb 21, 2024
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
4 participants