Skip to content

When building from source, don't use Microsoft.CodeAnalysis.BannedApiAnalyzers to avoid the prebuilt dependency #6961

@dagood

Description

@dagood

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.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions