* Re-enable CoreLib analyzers
CoreLib analyzers were unintentionally disabled with
6afe96cc2e950379d13a87efa1fa5a651cbce9bd. This re-enables the analyzers.
* Remove Microsoft.CodeAnalysis.Common from common
Microsoft.CodeAnalysis.Common shouldn't be referenced directly,
therefore removing that package from the common location and only
restoring and marking it as an analyzer in the libraries restore phase.
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset>
</PropertyGroup>
<ItemGroup Condition="'$(EnableAnalyzers)' == 'true'">
- <PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisVersion)" />
- <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.4.0-beta2-final" />
- <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
- <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" />
+ <PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+ <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" PrivateAssets="all" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" PrivateAssets="all" />
</ItemGroup>
</Project>
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
<SkipCommonResourcesIncludes>true</SkipCommonResourcesIncludes>
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
- <EnableAnalyzers>false</EnableAnalyzers>
+ <EnableAnalyzers>true</EnableAnalyzers>
</PropertyGroup>
<!-- Platform specific properties -->
<Language>C#</Language>
</PropertyGroup>
+ <ItemGroup>
+ <!--
+ Microsoft.CodeAnalysis.Common shouldn't be referenced directly but is needed by the analyzer depproj restore.
+ TODO: Remove when project restore is enabled for non test projects: https://github.com/dotnet/corefx/issues/41512.
+ -->
+ <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.4.0-beta2-final" PrivateAssets="all" />
+ </ItemGroup>
+
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.SaveItems" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
<Target Name="GenerateAnalyzersPropsFile"