内容目录
To improve project code quality, analyzers are often installed.
However, these analyzers occupy 10MB when generating project program files. Since these DLLs are unnecessary, they should not be left taking up space.
You can use the built-in Property Manager in VS to remove them.
You can also do this manually.
Open the project .csproj
file and find the following two nodes:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CodeAnalysisRuleSet>Alarm.Cpanel.ruleset</CodeAnalysisRuleSet>
<DefineConstants>TRACE;CORS;GY</DefineConstants>
<DocumentationFile></DocumentationFile>
<OutputPath></OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CodeAnalysisRuleSet>Alarm.Cpanel.ruleset</CodeAnalysisRuleSet>
<DefineConstants>CORS;GY</DefineConstants>
</PropertyGroup>
These two are the configurations for Debug and Release. Remove the following line:
<CodeAnalysisRuleSet>Alarm.Cpanel.ruleset</CodeAnalysisRuleSet>
Then find:
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Add Condition="'$(Configuration)'=='DEBUG'"
in front of Include,
for example:
<PackageReference Condition="'$(Configuration)'=='DEBUG'" Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
文章评论