Enable IDE0005 analyzer in the build
See original GitHub issueSee the conversation in https://github.com/dotnet/aspnetcore/pull/47540#issuecomment-1523799428. In order to unblock updating the SDK, I needed to add dotnet_diagnostic.EnableGenerateDocumentationFile.severity = none
to the .globalconfig
file. The new SDK was breaking the build for projects that don’t have GenerateDocumentationFile=true
.
We should figure out how to enable GenerateDocumentationFile=true
for non product assemblies.
@sharwell suggested adding:
<PropertyGroup>
<!--
Make sure any documentation comments which are included in code get checked for syntax during the build, but do
not report warnings for missing comments.
CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
CS1712: Type parameter 'type_parameter' has no matching typeparam tag in the XML comment on 'type_or_member' (but other type parameters do)
-->
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn),1573,1591,1712</NoWarn>
</PropertyGroup>
I think we should only set those NoWarn
for non-product level assemblies. So we need to do some build logic to ensure those doc warnings still occur for product projects that have public API.
More info at:
Issue Analytics
- State:
- Created 5 months ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
IDE0005: Remove unnecessary import - .NET
Learn about code analysis rule IDE0005: Remove unnecessary using directives. ... To enable this rule on build, you need to enable XML ...
Read more >visual studio - IDE0005 not reported as build failure even ...
I want the build of my project to fail if there are unused usings. ... IDE0005.severity = error ... This analyser is needed...
Read more >code analysis is disabled, it runs anyway
I've got code analysis configured for the release build, but switched off for debug. Still the code analysis is ... IDE0005 Using directive...
Read more >Show unnecessary imports in the Visual Studio's error ...
I don't like having extra imports in files. By default, Visual Studio shows them as faded and provide a quick fix to remove...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It may have been marked as fixed, but I’m on the latest version of 7 and it still exists.
I just updated my Visual Studio to 17.7 GA and am now seeing this issue in my .NET 7 project when building.
Removing
dotnet_diagnostic.IDE0005.severity = error
from the.editorconfig
fixes it.