Recently used MVC to do a project problem, using Debug=true to generate browsing without problems, access to all normal;
But with Debug=false released, open the site normal, but no style, check the code found that there is a CSS file is not downloaded;
Post-post CSS links are like this
<link href= "/content/css?v=v8chmyqvlf5eyjvwkqmmv6yejw7lvy0_eslyrg" rel= "stylesheet" >
The browser opens this path (/CONTENT/CSS?V=V8CHMYQVLF5EYJVWKQMMV6YEJW7LVY0_ESLYRG) with 403 blocked access: Access is denied; then the path to the browser will find that the path automatically adds a "/" Behind the CSS. , that is, to become such a/content/css/?v=v8chmyqvlf5eyjvwkqmmv6yejw7lvy0_eslyrg (note the Red "/"); The browser is looking for the CSS folder instead of the CSS file before the translation, and direct access to the real CSS link (real link:/content/site.css) can be opened normally. Why so, see the other CSS normal, only this is a problem.
Solve:
content Folder There is indeed a CSS folder, the CSS folder deleted and then released, solve the problem;
Other related code
The binding code is like this
Bundles. ADD (New Stylebundle ("~/content/css"). Include ("~/content/site.css"));
Generated CSS So
/content/css?v=v8chmyqvlf5eyjvwkqmmv6yejw7lvy0_eslyrg
Actual path
/content/site.css