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

[10-preview.2] CS0673 error from XmlCommentGenerator #61019

Open
1 task done
martincostello opened this issue Mar 19, 2025 · 2 comments · May be fixed by #61085
Open
1 task done

[10-preview.2] CS0673 error from XmlCommentGenerator #61019

martincostello opened this issue Mar 19, 2025 · 2 comments · May be fixed by #61085
Assignees
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-openapi
Milestone

Comments

@martincostello
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Building an existing application with ASP.NET Core 10 preview 2 with XML documentation enabled, I get the following errors:

  API failed with 3 error(s) (7.4s)
    C:\Coding\martincostello\api\artifacts\obj\API\debug\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(304,152): error CS0673: System.Void cannot be used from C# -- use typeof(void) to get the void type object
    C:\Coding\martincostello\api\artifacts\obj\API\debug\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(304,203): error CS0246: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)
    C:\Coding\martincostello\api\artifacts\obj\API\debug\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(313,169): error CS0673: System.Void cannot be used from C# -- use typeof(void) to get the void type object

Expected Behavior

The application compiles.

Steps To Reproduce

  1. Clone martincostello/api@c8e76ab
  2. Build the solution

Exceptions (if any)

No response

.NET Version

10.0.100-preview.2.25164.34

Anything else?

This looks similar to #60417, but that's closed and marked as fixed for preview 2, so I assume this is a different issue with the same symptom.

@martincostello martincostello added area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-openapi labels Mar 19, 2025
@martincostello
Copy link
Member Author

martincostello commented Mar 20, 2025

While trying out a nightly for #60977 (comment) I noticed that this is still the case as of 10.0.100-preview.3.25169.19, so must be a different failure mode.

@captainsafia
Copy link
Member

@martincostello OK! Tracked down what I missed here. The issue is with void-returning Tasks. Those still go through the codepath that tries to emit System.Void instead of void. Fix incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-openapi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants