You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No errors or warnings are shown when running dotnet build like they are in the error list (or other variations on this, like having no TreatWarningsAsErrors or having editorconfig setting severity to error):
usingSystem;
root = true
[*.cs]# IDE0005: Using directive is unnecessary.dotnet_diagnostic.IDE0005.severity = warning
Adding <GenerateDocumentationFile>true</GenerateDocumentationFile> fixes the problem, but I don't think I should have to add this. The point of EnforceCodeStyleInBuild is so that CI fails on things we miss that would bring clutter to the error list. If IDE0005 is showing in the error list without GenerateDocumentationFile, it should fail CI without GenerateDocumentationFile.
Besides that, it has awful discoverability to have to set GenerateDocumentationFile to get EnforceCodeStyleInBuild to work with IDE0005. GenerateDocumentationFile was a lucky guess based on a comment I saw on Twitter last month, and I'd already tried this four or five times since EnforceCodeStyleInBuild shipped and I completely failed and gave up each time.
…ngs) on build
Due to dotnet#41640, enabling IDE0005 on build requires users to enable generation of XML documentation comments. Even though this is documented with a note on IDE0005's [doc page](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005), we have had numerous reports of users not figuring this out and spending lot of cycles fighting with this, especially given other IDE diagnostics work just fine on build. We have had many user reports of the same: dotnet#58103, dotnet#53720, dotnet#57539, OpenRA/OpenRA#19747 and numerous other offline queries.
This change enhances the IDE0005 analyzer to now detect the case when IDE0005 is being reported as a warning or an error in the IDE, but `GenerateDocumentationFile` is `false` for the project, which would mean IDE0005 wouldn't be reported on build. The analyzer reports a special helper diagnostic for this case, which recommends the user to set this property to `true` in their project file to enable IDE0005 on build. This should reduce the pain for customers who try to enforce IDE0005 on build and get hit by this issue.
Version Used: dotnet 5.0.300
No errors or warnings are shown when running
dotnet build
like they are in the error list (or other variations on this, like having no TreatWarningsAsErrors or having editorconfig setting severity to error):Adding
<GenerateDocumentationFile>true</GenerateDocumentationFile>
fixes the problem, but I don't think I should have to add this. The point of EnforceCodeStyleInBuild is so that CI fails on things we miss that would bring clutter to the error list. If IDE0005 is showing in the error list without GenerateDocumentationFile, it should fail CI without GenerateDocumentationFile.Besides that, it has awful discoverability to have to set GenerateDocumentationFile to get EnforceCodeStyleInBuild to work with IDE0005. GenerateDocumentationFile was a lucky guess based on a comment I saw on Twitter last month, and I'd already tried this four or five times since EnforceCodeStyleInBuild shipped and I completely failed and gave up each time.
/cc @jmarolf
The text was updated successfully, but these errors were encountered: