HTTP错误403.14 - 禁止 - MVC4 .net 4.5捆绑 [英] HTTP Error 403.14 - Forbidden - MVC4 .net 4.5 bundles
问题描述
我使用razor引擎创建了一个带有.net 4.5的MVC4应用程序。使用visual studio在本地运行时工作正常。
I made a MVC4 application with .net 4.5 using razor engine. It works fine when run locally with visual studio.
当我在Windows Server 2008 R2上部署到IIS(所有Windows更新完成)时,我的捆绑包不起作用且CCS未加载。我尝试在服务器上查看该站点,查看源代码转到css的bundle链接,然后加载一些css然后出现IIS错误:
When I deploy to IIS on windows server 2008 R2(all windows updates done), it appears my bundles do not work and the CCS is not loading. I tried viewing the site on the server, viewed source went to the bundle link for the css, and it loads some css and then there is an IIS error of:
HTTP错误403.14 - 禁止将Web服务器配置为不是
列出此目录的内容。
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
我尝试过:
1)确保.net 4.5已安装。
2)已添加< modules runAllManagedModulesForAllRequests =true/>
到我的web.config
3)Ran %windir%\ Mesrosoft.NET \ Framework64 \ v4 .0.30319 \aspnet_regiis.exe -ir
in cmd
4)检查我的应用程序池是否设置为集成模式
5)检查它是否已设置使用.net 4
1) Ensured .net 4.5 is installed.
2) Added <modules runAllManagedModulesForAllRequests="true"/>
to my web.config
3) Ran %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
in cmd
4) Checked that my app pool was set to Integrated Mode
5) Checked that it's set to use .net 4
推荐答案
你会在这里找到答案:ASP.NET MVC framework 4.5 CSS包没有在托管上工作
You'll find your answer here: ASP.NET MVC framework 4.5 CSS bundles does not work on the hosting
简短的回答是确保您的软件包名称与您网站中的路径名称不冲突。
The short answer is to make sure that your bundle names don't conflict with the names of paths in your sites.
这篇关于HTTP错误403.14 - 禁止 - MVC4 .net 4.5捆绑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!