[英]Swagger Ui not load static files on asp.net mvc
i'm using swagger ui in my asp.net mvc我在我的 asp.net mvc 中使用 swagger ui
Swashbuckle v 5.6 Swashbuckle v 5.6
asp.net v 4.8 asp.net v 4.8
on local machine everythink working successfully but unfortunately after deploy website to cloud, swagger not load static content, but wen i navigate to these resources using chrome it's loadded successfully在本地机器上,everythink 工作成功,但不幸的是,在将网站部署到云后,swagger 没有加载静态内容,但是我使用 chrome 导航到这些资源,它已成功加载
i config swagger using:我配置招摇使用:
public static void Register()
{
var thisAssembly = typeof(SwaggerConfig).Assembly;
GlobalConfiguration.Configuration
.EnableSwagger(c =>
{
c.Schemes(new[] { "http", "https" });
c.IgnoreObsoleteActions();
c.SingleApiVersion("v1", "Console - API");
c.ApiKey("auth")
.Description("API Key Authentication")
.Name("auth")
.In("header");
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
c.IncludeXmlComments(String.Format(@"{0}\bin\docs.xml", System.AppDomain.CurrentDomain.BaseDirectory));
c.UseFullTypeNameInSchemaIds();
})
.EnableSwaggerUi(c =>
{
c.DocumentTitle("Console - API");
c.EnableApiKeySupport("auth", "header");
c.InjectJavaScript(thisAssembly, "Console.API.Assets.Swagger.SwashbuckleCustomAuth.js");
c.InjectStylesheet(thisAssembly, "Console.API.Assets.Swagger.SwashbuckleCustomStyle.css");
});
}
Do i miss any thing?我想念什么吗? dose https effects swagger load static files?
剂量 https 效果招摇加载静态文件?
pss: i don't think this issue related to iis because i have placed a static file in root folder of the website and i was able to load it pss:我认为这个问题与 iis 无关,因为我在网站的根文件夹中放置了一个静态文件并且我能够加载它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.