Click here to Skip to main content
15,892,805 members
Please Sign up or sign in to vote.
1.60/5 (2 votes)
See more:
Hi All,
I have been facing a strange issue. I am working on a MVC web application which is running perfectly fine even if deployed on IIS without publishing the code.

But when I published the application and deployed it on IIS, some css stops working.
And when i inspected them using Chrome or Firefox developer tools, I found css URL like encrypted as below.

content/css>c=VF45qgffbn8977gas7g0s

and that makes me unable to find the problematic css.


Any body could give me some idea about this type of issue and CSS encrypted URL?


NOTE: I just found that the Encrypted CSS URL was due to reason that I published the application in Release Mode. But still m worried about why some css stops working in Release mode when deployed.
Posted

1 solution

It is bundling and or minimizing the CSS. MVC does it automatically in MVC. If you don't want to do it you can shut it off.

In your development environment you can set debug true
XML
<system.web>
    <compilation debug="true" />
    <!-- Lines removed for clarity. -->
</system.web>


or in the bundle.config you can set
C#
BundleTable.EnableOptimizations = true;
which will render it inert. To do this in production and you don't want to debug, then just use
C#
BundleTable.EnableOptimizations = true;


Resource: http://www.asp.net/mvc/overview/performance/bundling-and-minification[^]
 
Share this answer
 
Comments
VICK 25-Mar-15 0:30am    
BundleTable.EnableOptimizations = false; does it right for me... :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900