Skip to content

Improve XML generator for types defined in Microsoft.AspNetCore.Identity #60783

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

Open
captainsafia opened this issue Mar 6, 2025 · 5 comments
Assignees
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi
Milestone

Comments

@captainsafia
Copy link
Member

The Microsoft.AspNetCore.Identity assembly declares some types that do not play nicely with the XML comment generator.

The errors seem to fall into the following categories:

  • Better escaping of quoted strings in description outputs
  • Better handling of generic types that need to be mapped to open generic definitions
  • Better handling for internal types or public properties defined in internal types
Output of dotnet build

dotnet build
Restore complete (2.8s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
IdentityDemo failed with 85 error(s) and 2 warning(s) (22.3s)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,182): error CS1003: Syntax error, ',' expected
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,191): error CS1003: Syntax error, ',' expected
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,196): error CS1003: Syntax error, ',' expected
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,203): error CS1003: Syntax error, ',' expected
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(185,204): error CS0246: The type or namespace name 'TRole' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(185,320): error CS0246: The type or namespace name 'TRole' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(185,567): error CS0246: The type or namespace name 'TRole' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(188,204): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(188,384): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(188,500): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(188,621): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(188,909): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(194,480): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(199,307): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(200,339): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(202,294): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(205,83): error CS0122: 'StreamExtensions' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(208,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(209,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(210,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(211,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(212,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(213,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(214,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(215,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(216,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(217,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(218,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(219,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(220,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(221,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(222,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(223,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(224,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(225,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(226,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(227,88): error CS0122: 'IdentityEndpointsJsonSerializerContext' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(326,336): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(326,352): warning CS0618: 'ISystemClock' is obsolete: 'Use TimeProvider instead.'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(327,336): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(334,195): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(351,201): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(351,347): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(351,570): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(351,726): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(369,193): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(372,202): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,182): error CS0103: The name 'remember' does not exist in the current context
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,191): error CS0026: Keyword 'this' is not valid in a static property, static method, or static field initializer
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,196): error CS0103: The name 'browser' does not exist in the current context
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(390,130): error CS1729: 'XmlParameterComment' does not contain a constructor that takes 8 arguments
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(399,202): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(418,345): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(418,361): warning CS0618: 'ISystemClock' is obsolete: 'Use TimeProvider instead.'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(419,345): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(420,204): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(425,89): error CS0122: 'TimeProviderClock' is inaccessible due to its protection level
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(426,94): error CS0433: The type 'IdentityServiceCollectionExtensions' exists in both 'Microsoft.AspNetCore.Identity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Identity.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(427,94): error CS0433: The type 'IdentityServiceCollectionExtensions' exists in both 'Microsoft.AspNetCore.Identity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Identity.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(428,94): error CS0433: The type 'IdentityServiceCollectionExtensions' exists in both 'Microsoft.AspNetCore.Identity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Identity.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(429,94): error CS0433: The type 'IdentityServiceCollectionExtensions' exists in both 'Microsoft.AspNetCore.Identity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Identity.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(431,94): error CS0433: The type 'IdentityServiceCollectionExtensions' exists in both 'Microsoft.AspNetCore.Identity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Identity.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(433,94): error CS0433: The type 'IdentityServiceCollectionExtensions' exists in both 'Microsoft.AspNetCore.Identity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Identity.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(434,94): error CS0433: The type 'IdentityServiceCollectionExtensions' exists in both 'Microsoft.AspNetCore.Identity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.Extensions.Identity.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(492,200): error CS0246: The type or namespace name 'TRole' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(493,202): error CS0246: The type or namespace name 'TRole' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(521,205): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(522,207): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(524,205): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(525,210): error CS0246: The type or namespace name 'TUserLogin' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(526,210): error CS0246: The type or namespace name 'TUserLogin' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(534,208): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(535,208): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(536,254): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(537,206): error CS0246: The type or namespace name 'TUserToken' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(557,204): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(558,206): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(560,204): error CS0246: The type or namespace name 'TRole' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(561,208): error CS0246: The type or namespace name 'TUserRole' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(562,204): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(563,209): error CS0246: The type or namespace name 'TUserLogin' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(564,209): error CS0246: The type or namespace name 'TUserLogin' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(577,207): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(578,207): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(579,253): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(580,251): error CS0246: The type or namespace name 'TUser' could not be found (are you missing a using directive or an assembly reference?)
/workspaces/IdentityDemo/obj/Debug/net10.0/generated/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs(581,205): error CS0246: The type or namespace name 'TUserToken' could not be found (are you missing a using directive or an assembly reference?)

@captainsafia captainsafia added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Mar 6, 2025
@captainsafia captainsafia self-assigned this Mar 6, 2025
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-identity Includes: Identity and providers label Mar 6, 2025
@captainsafia captainsafia added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-identity Includes: Identity and providers api-suggestion Early API idea and discussion, it is NOT ready for implementation labels Mar 6, 2025
@captainsafia captainsafia added this to the Backlog milestone Mar 6, 2025
@martincostello
Copy link
Member

I think I hit this one today in my OpenAPI extensions library. I also had another error about the wrong number of constructor parameters to something.

I'll do a bit more digging tomorrow and provide a link to a repro if that doesn't sound like something you're already aware of.

I did try the snippet from the release notes to turn the generator off, but it didn't seem to work.

@captainsafia
Copy link
Member Author

I also had another error about the wrong number of constructor parameters to something.

Hmmmm....that one might be something different. Looking forward to seeing a repro and shipping a fix. Depending on timing we might be able to squeeze it in for Preview 3.

I did try the snippet from the release notes to turn the generator off, but it didn't seem to work.

Uh-oh. Any chance you share the relevant snippets from your project file?

@martincostello
Copy link
Member

If you gloss over the fact there's p1->p2 breaking changes I haven't tackled yet (the last 3 errors), you can see the source generator errors by building martincostello/openapi-extensions@c92c5e1.

  MartinCostello.OpenApi.Extensions net10.0 failed with 13 error(s) (12.3s)
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(199,368): error CS1003: Syntax error, ',' expected
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(199,369): error CS1003: Syntax error, ',' expected
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(199,388): error CS1003: Syntax error, ',' expected
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(202,471): error CS1003: Syntax error, ',' expected
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(202,472): error CS1003: Syntax error, ',' expected
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(202,491): error CS1003: Syntax error, ',' expected
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(199,369): error CS0103: The name 'IDescriptionService' does not exist in the current context
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(199,318): error CS1729: 'XmlParameterComment' does not contain a constructor that takes 6 arguments
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(202,472): error CS0103: The name 'IDescriptionService' does not exist in the current context
    C:\Coding\martincostello\openapi-extensions\artifacts\obj\MartinCostello.OpenApi.Extensions\release_net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(202,421): error CS1729: 'XmlParameterComment' does not contain a constructor that takes 6 arguments
    C:\Coding\martincostello\openapi-extensions\src\OpenApi.Extensions\Transformers\AddParameterDescriptionsTransformer.cs(28,41): error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.IList<Microsoft.OpenApi.Models.Interfaces.IOpenApiParameter>' to 'System.Collections.Generic.IList<Microsoft.OpenApi.Models.OpenApiParameter>'
    C:\Coding\martincostello\openapi-extensions\src\OpenApi.Extensions\Transformers\AddExamplesTransformer.cs(69,37): error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.IList<Microsoft.OpenApi.Models.Interfaces.IOpenApiParameter>' to 'System.Collections.Generic.IList<Microsoft.OpenApi.Models.OpenApiParameter>'
    C:\Coding\martincostello\openapi-extensions\src\OpenApi.Extensions\Transformers\AddExamplesTransformer.cs(74,35): error CS1503: Argument 1: cannot convert from 'Microsoft.OpenApi.Models.Interfaces.IOpenApiRequestBody' to 'Microsoft.OpenApi.Models.OpenApiRequestBody'
  MartinCostello.OpenApi.Extensions net9.0 succeeded (12.0s) → artifacts\bin\MartinCostello.OpenApi.Extensions\release_net9.0\MartinCostello.OpenApi.Extensions.dll

Build failed with 13 error(s) in 30.9s

@martincostello
Copy link
Member

Uh-oh. Any chance you share the relevant snippets from your project file?

I changed this:

- <PackageReference Include="Microsoft.AspNetCore.OpenApi" />
+ <PackageReference Include="Microsoft.AspNetCore.OpenApi" GeneratePathProperty="true" />

Then added:

+ <Target Name="DisableCompileTimeOpenApiXmlGenerator" BeforeTargets="CoreCompile">
+   <ItemGroup>
+     <Analyzer Remove="$(PkgMicrosoft_AspNetCore_OpenApi)/analyzers/dotnet/cs/Microsoft.AspNetCore.OpenApi.SourceGenerators.dll" />
+   </ItemGroup>
+ </Target>

It doesn't seem to have any effect, as I still end up with 13 errors.

@martincostello
Copy link
Member

It doesn't seem to have any effect, as I still end up with 13 errors.

This was me being stupid 🤦.

Because I had references to both Microsoft.AspNetCore.OpenApi and Microsoft.OpenApi in the same file, I mistakenly added GeneratePathProperty="true" to the reference for Microsoft.OpenAp.

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 area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-openapi
Projects
None yet
Development

No branches or pull requests

2 participants