Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Not Working After Published

Tags:

c#

asp.net-mvc

I got errors (Not Showing CSS) in my project after deployed to server, it works fine in local .I found same questions like this and tried them all but still im unable to solved .

what i have tried :

Style bundling not working after IIS deployment (MVC 4)

BundleConfig not rendered after publish in IIS

ASP.NET MVC Bundle not rendering script files on staging server. It works on development server

ASP.NET MVC framework 4.5 CSS bundles does not work on the hosting

Why is my CSS bundling not working with a bin deployed MVC4 app?

Error:

enter image description here

CSS Shows In Server Like This

<link href="/PMTEST/bundles/font-awesome/css?v=iW7LN24NnEoW62YKSq4wmEVP62Z-QPaYj8Wc4pAfkQA1" rel="stylesheet">
<link href="/PMTEST/bundles/animate/css?v=TS_TayB91ibtNEIEuFyRTY4MKruiSouKnZGvXM9wZzc1" rel="stylesheet">
<link href="/PMTEST/bundles/bootstrap/css?v=fGVgsGSw8MzJqPS1QdcxeRW2yrw4tez5BLZBchwK_HE1" rel="stylesheet">
<link href="/PMTEST/bundles/icon?v=Xt7dqD5fI6gBI3RBoPWSt1nfcmgT1f4bGcYcuT_dBno1" rel="stylesheet">

Bundle Config in my application

 bundles.Add(new StyleBundle("~/bundles/font-awesome/css").Include(
                      "~/Vendor/fontawesome/css/font-awesome.min.css", new CssRewriteUrlTransform()));

In My Layout Page i used Bundle like

   @Styles.Render("~/bundles/font-awesome/css")
like image 458
Thisara Subath Avatar asked May 23 '26 10:05

Thisara Subath


1 Answers

Solved , just add

BundleTable.EnableOptimizations = false;

in ~/App_Start/BundleConfig.cs

like image 106
Thisara Subath Avatar answered May 25 '26 00:05

Thisara Subath



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!