ASP.NET MVC框架4.5 CSS束不能在托管工作 [英] ASP.NET MVC framework 4.5 CSS bundles does not work on the hosting
问题描述
我写在MVC4应用乳宁港一个App。
I am runing an App on app harbor written in MVC4.
CSS文件一束不工作。在调试模式下我的本地计算机上我看到了应用程序的code和我看到的文件。该应用程序按预期工作。
A bundle of css files doesnt work. In my local computer in debug mode I see the code of the App and I see the files. The App Works as expected.
<link href="/Content/css/home/basic-jquery-slider.css" rel="stylesheet"/>
<link href="/Content/css/home/Home.css" rel="stylesheet"/>
当我上传应用Appharbor我看到在code包,但应用程序不工作。
When I upload the app to Appharbor I see the bundle in the code but the App doesnt work.
<link href="/Content/css/home?v=zhVOIpUNuvCOZhJyBcQWpMlozayor4te6k-pM29wHqI1" rel="stylesheet"/>
当我浏览了的href该链接
我得到的 403 - 禁止:拒绝访问
如何解决呢?
推荐答案
我的猜测是,路径内容/ CSS
存在于您的应用程序的磁盘。在这种情况下的IIS将处理请求,不MVC
My guess is that the path Content/css
exists on disk in your app. In this case IIS would be handling the request, not MVC.
请确保该包(该StyleBundle构造函数的参数)的虚拟路径并不在文件系统中的文件夹相匹配。
Make sure that the virtual path for the bundle (the parameter of the StyleBundle constructor) doesn't match a folder in the filesystem.
这篇关于ASP.NET MVC框架4.5 CSS束不能在托管工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!