You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be a duplicate or by design, didn't find concrete answer.
TL;DR: Adding a nuget package reference that targets .netstandard2.0 removes most CAXXXX rules
Csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);NU1605</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0.0" />
<!--
Adding below package reference causes the compiler error to disappear.
Remove below package reference to reproduce the compiler error.
Is it because this package is built for .netstandard2.0?
-->
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.33" />
</ItemGroup>
</Project>
Violations of CA2254 (and others) disappear when reference to (in this case) Microsoft.Azure.WebJobs is included in the project (can be someone else's dependency too). Removing this package reference restores compiler error (in this case of CA2254).
Is there some msbuild property i can set to preserve the proper ruleset? Seems not right to lose a lot of rules by simply having .netstandard2.0 transient nuget package dependency in the project
The text was updated successfully, but these errors were encountered:
olstakh
changed the title
Targeting .netstandard2.0 package removes most CAXXXX rules
Targeting Microsoft.AzureWebJobs package removes most CAXXXX rules
Dec 31, 2024
This might be a duplicate or by design, didn't find concrete answer.
TL;DR: Adding a nuget package reference that targets
.netstandard2.0
removes most CAXXXX rulesCsproj:
Violations of CA2254 (and others) disappear when reference to (in this case)
Microsoft.Azure.WebJobs
is included in the project (can be someone else's dependency too). Removing this package reference restores compiler error (in this case of CA2254).Is there some msbuild property i can set to preserve the proper ruleset? Seems not right to lose a lot of rules by simply having .netstandard2.0 transient nuget package dependency in the project
The text was updated successfully, but these errors were encountered: