A quick fix is to move the Microsoft.CodeAnalysis.BannedApiAnalyzers line here into the earlier itemgroup:
|
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'"> |
|
<GlobalPackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All"/> |
|
</ItemGroup> |
|
|
|
<ItemGroup> |
|
<GlobalPackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="15.0.15" PrivateAssets="All" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" /> |
|
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="$(MicrosoftCodeAnalysisBannedApiAnalyzersVersion)" /> |
|
</ItemGroup> |
BannedApiAnalyzers has some intentional old dependencies and it's not feasible to build it during source-build. It's already been removed from source-build and we need to remove usages. dotnet/roslyn-analyzers#5619
BannedApiAnalyzers isn't one of the analyzers that ends up in the SDK product, so the only reason for source-build to build it is for code validation parity when building MSBuild's C# source code. That would help source-build developers write upstreamable code if the MSBuild C# code needs to be patched, but dev flows aren't the primary goal of source-build right now.
A quick fix is to move the
Microsoft.CodeAnalysis.BannedApiAnalyzersline here into the earlier itemgroup:msbuild/eng/Packages.props
Lines 46 to 53 in 15e80d5
BannedApiAnalyzers has some intentional old dependencies and it's not feasible to build it during source-build. It's already been removed from source-build and we need to remove usages. dotnet/roslyn-analyzers#5619
BannedApiAnalyzers isn't one of the analyzers that ends up in the SDK product, so the only reason for source-build to build it is for code validation parity when building MSBuild's C# source code. That would help source-build developers write upstreamable code if the MSBuild C# code needs to be patched, but dev flows aren't the primary goal of source-build right now.