-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-grpcIncludes: GRPC wire-up, templatesIncludes: GRPC wire-up, templates
Description
Description
In .NET 10 when adding Microsoft.AspNetCore.Grpc.Swagger v0.10.0, we receive the following error:
Method 'Apply' in type 'Microsoft.AspNetCore.Grpc.Swagger.Internal.XmlComments.GrpcXmlCommentsDocumentFilter' from assembly 'Microsoft.AspNetCore.Grpc.Swagger, Version=0.10.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
Method 'Apply' in type 'Microsoft.AspNetCore.Grpc.Swagger.Internal.XmlComments.GrpcXmlCommentsOperationFilter' from assembly 'Microsoft.AspNetCore.Grpc.Swagger, Version=0.10.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
at System.Reflection.RuntimeModule.GetDefinedTypes()
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable`1 parts, ControllerFeature feature)
at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes()
at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.get_ActionDescriptors()
at Asp.Versioning.ApiExplorer.ActionApiVersionMetadataCollationProvider.get_Version()
at Asp.Versioning.ApiExplorer.Internal.ApiVersionDescriptionCollection`1.ComputeVersion(IApiVersionMetadataCollationProvider[] providers)
at Asp.Versioning.ApiExplorer.Internal.ApiVersionDescriptionCollection`1.ComputeVersion()
at Asp.Versioning.ApiExplorer.Internal.ApiVersionDescriptionCollection`1.get_Items()
at Asp.Versioning.ApiExplorer.DefaultApiVersionDescriptionProvider.get_ApiVersionDescriptions()
at Microsoft.AspNetCore.Builder.IEndpointRouteBuilderExtensions.DescribeApiVersions(IEndpointRouteBuilder endpoints)
at Theseus.ServiceDefaults.Extensions.<>c__DisplayClass6_0.<ConfigureTheseus>b__0(SwaggerUIOptions options) in C:\Projects\CSTech\LaRedoute\Theseus_4_0\src\Infrastructure\Theseus.ServiceDefaults\Extensions.cs:line 301
at Microsoft.AspNetCore.Builder.SwaggerUIBuilderExtensions.UseSwaggerUI(IApplicationBuilder app, Action`1 setupAction)
at Theseus.ServiceDefaults.Extensions.ConfigureTheseus(WebApplication app, Boolean apiVersioning) in C:\Projects\CSTech\LaRedoute\Theseus_4_0\src\Infrastructure\Theseus.ServiceDefaults\Extensions.cs:line 299
at Program.<Main>$(String[] args)
Reproduction Steps
Create a .NET 10 ASP.NET Core Web API with libraries:
- Microsoft.AspNetCore.Grpc.Swagger: 0.10.0
- Swashbuckle.AspNetCore: 10.0.01
- Swashbuckle.AspNetCore.SwaggerUI: 10.0.01
In program.cs add:
{
foreach (var description in app.DescribeApiVersions())
{
var url = $"/swagger/{description.GroupName}/swagger.json";
var name = description.GroupName.ToUpperInvariant();
options.SwaggerEndpoint(url, name);
}
options.RoutePrefix = string.Empty;
});
The API should crash on app.DescribeApiVersions()
Expected behavior
No crash
Actual behavior
Crashes when trying to load types
Regression?
Yes. This used to work with .NET 9.
Known Workarounds
No response
Configuration
No response
Other information
No response
divi-94
Metadata
Metadata
Assignees
Labels
area-grpcIncludes: GRPC wire-up, templatesIncludes: GRPC wire-up, templates