C
C#12mo ago
julian

Error on activation

Class I'm trying to activate
public class SwaggerGenConfigureOptions : IConfigureOptions<SwaggerGenOptions>
{
private readonly IApiVersionDescriptionProvider _provider;

public SwaggerGenConfigureOptions(IApiVersionDescriptionProvider provider) => _provider = provider;

public void Configure(SwaggerGenOptions options)
{
foreach (var description in _provider.ApiVersionDescriptions)
{
options.SwaggerDoc(description.GroupName, new OpenApiInfo()
{
Title = "XXXXXXX Domain API",
Version = description.ApiVersion.ToString(),
Description = "API to read and change data in the Absence Domain" + (description.IsDeprecated ? " (deprecated)" : ""),
});
}
}
}
public class SwaggerGenConfigureOptions : IConfigureOptions<SwaggerGenOptions>
{
private readonly IApiVersionDescriptionProvider _provider;

public SwaggerGenConfigureOptions(IApiVersionDescriptionProvider provider) => _provider = provider;

public void Configure(SwaggerGenOptions options)
{
foreach (var description in _provider.ApiVersionDescriptions)
{
options.SwaggerDoc(description.GroupName, new OpenApiInfo()
{
Title = "XXXXXXX Domain API",
Version = description.ApiVersion.ToString(),
Description = "API to read and change data in the Absence Domain" + (description.IsDeprecated ? " (deprecated)" : ""),
});
}
}
}
Activation:
services.AddTransient<IConfigureOptions<SwaggerGenOptions>, SwaggerGenConfigureOptions>();
services.AddTransient<IConfigureOptions<SwaggerGenOptions>, SwaggerGenConfigureOptions>();
Error: Error msg was too long to be posted here. https://pastebin.com/x0NsubVB
Pastebin
Error C# - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server