Accessing the static content of an ASP.Net MVC project using IIS7

I created a website on my local IIS 7 with my own ASP.Net MVC project in its root.

Everything works fine except for static content. Going to http: // localhost: 8080 / Content / Site.css gives me 404. I see a folder in IIS Manager.

The content is supported perfectly with the small development server that you get when you start the application on Visual Studio 2008. Any ideas what might be wrong?

+4
source share
3 answers

The problem was the solution. Despite the fact that when I create the IIS7 website, I said that it would refer to the files as my user (it would not work at all), for the static file, it used the application pool user. Granting access to IIS APPPOOL \ MyApplication to the folder in which my project was fixed.

+5
source

What about

routes.RouteExistingFiles = true; 

in your Global.asax?

+3
source

Try going http: // localhost: 8080 /../../ Content / Site.css , not sure if your source URL matches the route.

Not really a programming issue.

+1
source

Source: https://habr.com/ru/post/1286617/


All Articles