Skip to content

Commit 1ec5e84

Browse files
committed
Disable loading code style analyzers when building from VS
1 parent 6bca3a3 commit 1ec5e84

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Diff for: Directory.Build.targets

+17
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,21 @@
7878
</KnownFrameworkReference>
7979
</ItemGroup>
8080

81+
<PropertyGroup>
82+
<CoreCompileDependsOn>$(CoreCompileDependsOn);RemoveCodeStyleAnalyzers</CoreCompileDependsOn>
83+
</PropertyGroup>
84+
85+
<!--
86+
CodeStyle analyzers inserted in the SDK might not be compatible with the current public version of Visual Studio,
87+
which causes failures when building from the IDE.
88+
-->
89+
<Target Name="RemoveCodeStyleAnalyzers" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
90+
<ItemGroup>
91+
<Analyzer Remove="@(Analyzer)" Condition="
92+
'%(FileName)' == 'Microsoft.CodeAnalysis.CodeStyle' or
93+
'%(FileName)' == 'Microsoft.CodeAnalysis.CodeStyle.Fixes' or
94+
'%(FileName)' == 'Microsoft.CodeAnalysis.CSharp.CodeStyle' or
95+
'%(FileName)' == 'Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes'"/>
96+
</ItemGroup>
97+
</Target>
8198
</Project>

0 commit comments

Comments
 (0)