Thursday, February 20, 2014

Error : CSS, Images not loading when Debub="false" in web.config for MVC Application

For MVC application, i came across problem while i set Debut="false" in web.config file and ultimately css and images not loading from BundleConfig file but when i set it to "true" will load all files.

While googling i got some Web.Config settings shown below, modify your web.config in the system.webServer section to run these requests through the BundleModule


But, this line of code for Web.Config not solved my problem. Finally, i got to know about bundle name in BundleConfig file, i chnaged it shown below.

- Before Change Path :
"~/Content/css" : My all CSS were reside under "Content/css"
- After Change:
"~/Content/css/css"

So, to get rid of the problem you need to give path exactly as per project and put extra "css" after it will resolve your problem for CSS not loading.