Skip to content
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

Can't build using SourceGenerator, xml documentation and warnings are errors #9

Closed
danzel opened this issue Jun 25, 2021 · 2 comments
Closed

Comments

@danzel
Copy link

danzel commented Jun 25, 2021

The code generated by the SourceGenerator creates warnings as it doesn't have XML documentation on it.
If you have "warnings are errors" enabled, then this breaks your build.

I think we need to put a header on the whole file like https://stackoverflow.com/a/2701832

Or maybe just put // <auto-generated /> before the SignalR.Strong namespace (Like on the SignalR.Strong.SourceGenerated namespace below)
https://github.com/mehmetakbulut/SignalR.Strong/blob/master/SignalR.Strong.SourceGenerator/HubGenerator.cs#L33

I've never debugged a source generator before so I'm not too sure.

Error as in build:
image

@mehmetakbulut
Copy link
Owner

mehmetakbulut commented Jul 29, 2021

Just published v0.3.2 to address this.

It appears compiler emits CS1591 regardless of // <auto-generated />. So I added short comments to each generated class and method. Ideally I would have made the generated classes private but I don't want to change that right now as people might rely on it and I'm hopeful source generation features will eventually be in SignalR itself as I mentioned in #8. Regardless, I have enabled doc flag on the sample project so at least the warning would be caught in the future if I end up making further changes here.

@danzel
Copy link
Author

danzel commented Jul 29, 2021

This fixes it, thanks!

@danzel danzel closed this as completed Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants