-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDE0005 not reported as build warning #58103
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
cc @mavasani |
Duplicate of #41640 (comment) |
mavasani
added a commit
to mavasani/roslyn
that referenced
this issue
Jan 13, 2022
…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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a simple project where I'm trying to enforce code style rules in build. It seems to be mostly working, but for some reason I noticed that IDE0005 warning doesn't show up when building the project, even though it is set as warning in my editorconfig file.
Here's what my csproj looks like:
Here's my editorconfig file. I've followed the instruction from this thread and set the severities using the IDExxxx code so they can be recognized by the compiler. I'm explicitly covering IDE0005 in my editorconfig:
And here's a Program.cs file that triggers a bunch of code style warnings:
Building this, the compiler reports many IDExxxx warnings, which indicates that my editorconfig file is being at least partially taken into account when building:
IDE0005 is missing from that list, though. I can see it being detected in the VS UI:
![image](https://user-images.githubusercontent.com/14302074/144661427-c0ee4a69-d78d-4c92-ada3-fae33cb2fa5f.png)
Is there anything I'm missing here? When I change the severity of IDE0005 in my editorconfig file, it reflects in the VS UI, but the build doesn't seem to catch it. It tried both building this from VS and from the command line, and the results are the same. I'd appreciate any pointers here.
The text was updated successfully, but these errors were encountered: