Is there a way to ignore all warnings of a nuget package by using the
<NoWarn></NoWarn>
tag in csproj file?
Is there a way to ignore all warnings of a nuget package by using the
<NoWarn></NoWarn>
tag in csproj file?
Suppress specific warnings for individual NuGet packages.
In Solution Explorer, select the NuGet package for which you want to suppress compiler warnings.
From the right-click menu or context menu, select Properties.
In the Suppress Warnings box of the package properties, enter the warning number to suppress for this package. If you want to suppress multiple warnings, separate the warning numbers with commas.
The warning has disappeared from Solution Explorer and the error list. In the project file, the NoWarn property will be set.
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<NoWarn>NU5104</NoWarn>
</PackageReference>
hope it helps you.
© 2022 - 2024 — McMap. All rights reserved.