The type or namespace name ‘OpenApiReference’ could not be found (are you missing a using directive or an assembly reference?)
Summary A .NET 10 developer encountered a compilation error indicating that the type OpenApiReference could not be found while attempting to configure Swagger authentication. The error was triggered by attempting to instantiate Microsoft.OpenApi.Models.OpenApiReference directly in the SwaggerGen configuration, assuming this class was available in the standard Swagger package. This postmortem analyzes why the OpenApiReference class … Read more