question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable IDE0005 analyzer in the build

See original GitHub issue

See 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:open
  • Created 5 months ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
scottkuhlcommented, Aug 14, 2023

It may have been marked as fixed, but I’m on the latest version of 7 and it still exists.

1reaction
ryanbueningcommented, Aug 9, 2023

I just updated my Visual Studio to 17.7 GA and am now seeing this issue in my .NET 7 project when building.

image

Removing dotnet_diagnostic.IDE0005.severity = error from the .editorconfig fixes it.

Read more comments on GitHub >

github_iconTop 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 >
ReferenceTrimmer
Easily identify which dependencies can be removed from a .NET project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found