Whistler
Whistler

Reputation: 1977

The changes not updating on server

I have build MVC 5 application which works fine when running via VS. When I publish it to the server first time it also works. Now I have made few correction to my css file and publish whole project again but website still see the old css file. I have removed all files from the server and tried few more times but it is still the same. When I check the css file on the server, the changes are inside the file.

I think it is related to MVC bundling as when I check the source it says that is accessing different file which is not even located on the server:

 <link href="/Content/cssmain?v=Ikj7NnMg3q9kTHR7ynWOJDQFGMZl3mtVMi_2EkOJxc41" rel="stylesheet"/>

How can I force VS to minificate my css file again?

I've tried cleaning, rebuilding but no luck

Edit: My bundle set up look like below and all files are located on the server in Content folder.

bundles.Add(new StyleBundle("~/Content/cssmain").Include(
                  "~/Content/bootstrap.css",
                  "~/Content/site.css",
                  "~/Content/ilightbox.css",
                  "~/Content/bannerscollection_zoominout.css"));

Many thanks

Upvotes: 1

Views: 182

Answers (2)

Doug Chamberlain
Doug Chamberlain

Reputation: 11341

Is it just you experiencing getting the old css file loaded? Or anyone who views the site?

Upvotes: 0

EdSF
EdSF

Reputation: 12341

I think it is related to MVC bundling as when I check the source it says that is accessing different file which is not even located on the server:

CDN location? External Css lib (yours or 3rd party)? unsure what you meant by "not located on server"?

Yup, it does (look like ASP.net Bundling in action) - check your Global.asax, App_Start/BundleConfig or _AppStart and see if the bundle configuration setup point to/reference the "correct" locations for your css (and or script).

Upvotes: 1

Related Questions