问题描述
我已经建立在我的本地IIS 7的Web站点在其根我自己的ASP.Net MVC项目。
I've create a web site on my local IIS 7 with my own ASP.Net MVC project on its root.
一切工作正常,除了静态内容。要的site.css给我404我可以看到在IIS管理器中的文件夹。
Everything is working fine except for the static content. Going to http://localhost:8080/Content/Site.css gives me a 404. I can see the folder on IIS Manager.
内容是配有小型开发服务器罚款你当您运行Visual Studio 2008中的任何想法应用可能是什么问题?
The content is served fine with the small development server you get when you run the application on Visual Studio 2008. Any ideas what might be wrong?
推荐答案
的问题是权限。即使当我创建IIS7的网站我告诉它来访问文件,我的用户(它不会在所有的工作,否则),静态文件,它是使用的应用程序池的用户。给到我的项目是固定的问题的文件夹访问IIS APPPOOL \\ MyApplication的。
The problem was permissions. Even though when I create the IIS7 web site I told it to access the files as my user (it wouldn't work at all otherwise), for static file it was using the user of the application pool. Giving access to IIS APPPOOL\MyApplication to the folder where my project was fixed the issue.
这篇关于访问与IIS7的ASP.Net MVC项目的静态内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!