kestrel 中某些后缀的文件 404 的解决办法
var provider = new FileExtensionContentTypeProvider();
// Add new mappings
provider.Mappings[".vue"] = "application/octet-stream";
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(@"D:\"),
RequestPath = "",
ContentTypeProvider = provider
});
除了已注册的某些后缀,kestrel拒绝返回其它后缀的文件(为了安全),这里添加了指定的后缀 .vue ,将kestrel能提供vue文件的下载