Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,6 @@ dotnet_diagnostic.IDE0330.severity = suggestion
# Use implicitly typed lambda
dotnet_diagnostic.IDE0350.severity = none

#Nullable suppression is unnecessary (not when multi-targeting to net472): https://github.com/dotnet/msbuild/issues/12726
dotnet_diagnostic.IDE0370.severity = none

# Value types are incompatible with null values. https://xunit.net/xunit.analyzers/rules/xUnit1012
dotnet_diagnostic.xUnit1012.severity = warning

Expand Down
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
<RuntimeOutputPlatformTarget>AnyCPU</RuntimeOutputPlatformTarget>
</PropertyGroup>

<!-- Many BCL APIs aren't nullable-annotated on .NET Framework, forcing null-forgiving ('!') suppressions
that are unneeded (and flagged by IDE0370) on the other TFMs of multi-targeted projects.
Disable nullable analysis for the net4x leg of such projects so those suppressions become unnecessary
everywhere. https://github.com/dotnet/msbuild/issues/12726 -->
<PropertyGroup Condition="'$(TargetFramework)' != '' and $(TargetFramework.StartsWith('net4')) and $(TargetFrameworks.Contains(';'))">
<Nullable>disable</Nullable>
</PropertyGroup>

<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificContentInPackage);ShipRefAssembliesToNuGetPackage</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
Expand Down
Loading