【发布时间】:2025-11-24 16:00:01
【问题描述】:
在 IIS 中运行时,我的 ASP.Net MVC 页面出现以下错误
可下载字体:下载失败(字体系列:“FontAwesome”样式:正常粗细:正常拉伸:正常 src 索引:1):status=2147746065 来源:http://localhost/MyApp/fonts/fontawesome-webfont.woff?v=4.1.01sharedStyle:1:126778
在本地运行相同的页面,一切正常。部署所有文件 FA 的路径是 C:\inetpub\wwwroot\MyApp\Content\Template\font-awesome-4.1.0
我尝试了Why font-awesome works on localhost but not on web ? 和ASP.NET MVC4 Bundling with Twitter Bootstrap 的所有解决方案
更新:
我按照 Shyju 的建议将 fileExtensions 添加到 system.webServer,但并没有改变问题。
捆绑有可能有问题吗?我使用它的方式如下:
public static void RegisterBundles(BundleCollection bundles)
{
StyleBundle sharedStyleBundle = new StyleBundle("~/bundles/sharedStyle");
sharedStyleBundle.Include("~/Content/Template/font-awesome-4.1.0/css/font-awesome.css");
...
bundles.Add(sharedStyleBundle);
...
}
【问题讨论】:
标签: css asp.net-mvc-4 iis font-awesome