Cannot access static resources Asp.Net Mvc 2 on IIS 7. when configured a Virtual Host.
I've set the following:
- In hosts.etc I've written the following "127.0.0.1 localhost blueprint"
- I've create in IIS 7 set the directory root to where the MVC 2 application is located and set the domain host name to blueprint over http and port 80.
I can open the site normally by going to http://blueprint , all MVC 2 functionalities work fine.
But the CSS won't load, everytime the system returns the error 404 status for a resource not found.
The css file is located in here /Views/Shared/screen.css .
I've tried the following to get a proper path:
Url.Content("~/Views/Shared/screen.css") Url.Content("/Views/Shared/screen.css") Url.Content("Views/Shared/screen.css")
Or just "~/Views/Shared/screen.css" "/Views/Shared/screen.css" "Views/Shared/screen.css"
or
"screen.css".
The css file is requested from a master page located in the same directory as the screen.css file , Views/Shared/master.master .