Home After switching Visual Studio to use local IIS server, image and style files not found

# After switching Visual Studio to use local IIS server, image and style files not found

user5374
1#
user5374 Published in September 19, 2018, 6:44 pm

I changed my website properties in Visual Studio 2010 to "Use local IIS Web Server" instead of the Visual Studio Development Server, and clicked "Create Virtual Directory".

Now my images and styles are not found when I view the website in localhost. The paths in the website are relative. The 404 message says the physical path is "C:\inetpub\wwwroot", which is not the application root. If I copy my image and style folders into "C:\inetpub\wwwroot" then the images appear.

Have I missed some configuration setting to ensure static files come from the application rather than the wwwroot?

• show how you include image and css files in your View. The proper way is to use Url.Content(...). – Igor Feb 22 '13 at 15:50