-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIfeature-openapi
Description
Currently if you use the ApiDescription.Server you need to do reflection to see if it is running with this server.
using System.Reflection;
var builder = WebApplication.CreateBuilder(args);
// I don't want this!!
if (Assembly.GetEntryAssembly()?.GetName().Name != "GetDocument.Insider")
{
builder.AddServiceDefaults();
}This is very bad, I don't want any reflection in my code (AOT build), maybe it can inject a special environment variable in the config?
I want (or similar):
if (builder.Configuration.GetValue<bool>("ASPNET_APIDESCRIPTION"))
{
...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIfeature-openapi