Is there an existing issue for this?
Describe the bug
If I have a web application, that uses a custom library, and that library makes the call to IApiVersioningBuilder.AddOpenApi(), then the XML documentation file of the web application is not read.
The bug is in the Asp.Versioning.OpenApi project: IApiVrsioningBuilderExtensions.GetAssemblies:
private static Assembly[] GetAssemblies( Assembly callingAssembly )
{
var assemblies = new List<Assembly>( capacity: 2 ) { callingAssembly };
if ( Assembly.GetEntryAssembly() is { } entryAssembly && assemblies[0] != callingAssembly ) // callingAssembly should be entryAssembly
{
assemblies.Add( entryAssembly );
}
return [.. assemblies];
}
That 2nd boolean will always resolve to false because it's comparing the element to itself. It should be comparing it to the entryAssembly.
Expected Behavior
The XML documentation file of the Entry Assembly is read.
Steps To Reproduce
Web App
builder.Services.AddOpenApiWithVersioning();
Custom Library
public IServiceCollection AddOpenApiWithVersioning(this IServiceCollection services)
{
services.AddApiVersioning().AddOpenApi();
}
Exceptions (if any)
No response
.NET Version
10.0.104
Anything else?
Asp.Verisoning.OpenApi v10.0.0-preview.2
Is there an existing issue for this?
Describe the bug
If I have a web application, that uses a custom library, and that library makes the call to
IApiVersioningBuilder.AddOpenApi(), then the XML documentation file of the web application is not read.The bug is in the
Asp.Versioning.OpenApiproject:IApiVrsioningBuilderExtensions.GetAssemblies:That 2nd boolean will always resolve to false because it's comparing the element to itself. It should be comparing it to the
entryAssembly.Expected Behavior
The XML documentation file of the Entry Assembly is read.
Steps To Reproduce
Web App
Custom Library
Exceptions (if any)
No response
.NET Version
10.0.104
Anything else?
Asp.Verisoning.OpenApi
v10.0.0-preview.2