ASP.NET MVC 3 - Images not found if deploy as application on IIS 7.5?

I can solve it if I put url in Url. Content("~/content/img/site-logo. Png") but I don't want to change all my images now I am not aware of any IIS setting, other than of course setting your application to run at the root of the IIS web site You should always use url helpers when dealing with urls in an ASP.NET MVC application.

So you really should change all hardcoded urls, and by the way this doesn't include only images, it could be also anchor hrefs, form actions, hardcoded urls in your javascript files.

I can solve it if I put url in Url. Content("~/content/img/site-logo. Png") but I don't want to change all my images now.

I am not aware of any IIS setting, other than of course setting your application to run at the root of the IIS web site. You should always use url helpers when dealing with urls in an ASP. NET MVC application.So you really should change all hardcoded urls, and by the way this doesn't include only images, it could be also anchor hrefs, form actions, hardcoded urls in your javascript files, ...

You can create virtual directory in root iis project and point it on directory with images. BUT, you should better spend this time to clean up your image paths because it, probably, will bite you in future again.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions