【发布时间】:2017-06-06 13:21:17
【问题描述】:
早上好,我开发了一个 mvc 5 应用程序,在开发过程中我使用了 IIS Express,那里的所有文件都完美加载,当我上传到我的 IIS Local (7) 仍然在我的机器上进行测试时,我意识到有几个文件是未加载。
Failed to load resource: the server responded with a status of 404 (Not Found)
glyphicons-halflings-regular.woff
检查时我发现文件没有加载,因为实际上尝试执行 GET 的路径不正确。它试图上路:
http://localhost/content/fonts/glyphicons-halflings-regular.woff
但正确的文件应该是:
http://localhost/aprovacoes/content/fonts/glyphicons-halflings-regular.woff
在获取中,项目名称丢失,因此未加载。
为了解决这个特定来源的问题,我需要编辑 bootstrap.min.css 文件并从 url 更改 url:
url(/content/fonts/glyphicons-halflings-regular.woff)
为
url(aprovacoes/content/fonts/glyphicons-halflings-regular.woff)
但是在每个项目中都没有加载几个文件,为了解决我正在逐个文件编辑 css 文件,难道没有另一种方法可以在所有 css 文件中映射这个正确的路径吗?
非常感谢您
【问题讨论】:
-
在 url 中需要项目名称对我来说似乎很奇怪,但这取决于您的 iis 设置以及项目的设置和发布方式。如果您可以添加有关可能有用的设置的信息。
标签: c# asp.net asp.net-mvc iis-7