-
Notifications
You must be signed in to change notification settings - Fork 256
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
Framework Conditioned warning properties are not respected for multi-targeting projects #5712
Comments
A restore is needed to update the suppressions, a rebuild should have done that however. @mishra14 would you try this out? |
The csproj file reads like the following:
Issues:
|
The reason is that we do not pass conditions to msbuild when requesting properties. I will see if it is possible to get this done as part of #5501 |
Update - I looked more into this and this is a VS only problem. Since, in dotnet restore and msbuild /t:restore calls we can pass in additional properties. |
Looked more into this - The core issue is that in multi-targeting projects, the project system adds a condition on the first tfm of the project. I have filed an issue with them - dotnet/project-system#2804 I will wait for their response/traction. |
Just to clarify the status here; Framework conditioned no warns are not supported in either CLI or VS. Repro that shows this: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;netcoreapp2.1</TargetFrameworks>
<NoWarn Condition="'$(TargetFramework)' == 'netcoreapp2.2'">NU1701</NoWarn>
<AssetTargetFallback>net46</AssetTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NuGet.Credentials" Version="4.6.2" />
</ItemGroup>
</Project> |
From: https://developercommunity.visualstudio.com/content/problem/88109/cannot-suppress-nu1701-from-project-properties.html
Repro steps:
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
Expected:Warnings should disappear
Actual: Warnings still show up:
Looking at the asset file, the warning is persisted:
Edit by @nkolev92; repro below
The text was updated successfully, but these errors were encountered: