//StartUp.cs文件中Configure方法中添加以下代码
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Directory.GetCurrentDirectory()),
ContentTypeProvider = new FileExtensionContentTypeProvider(new Dictionary<string, string>
{
{ ".wgt", "application/widget" }
})
});
IIS中配置MIME类型