I'm using Dotless and System.Web.Optimizations.LessBundle to include Less stylesheets in my MVC 5 app. Everything is working in Debug and Release on my local machine.
I basically followed the same steps that this blog post did.
My bundle code looks like this:
bundles.Add(new LessBundle("~/Content/css/mySheet").Include(
"~/Content/lib/normalize/normalize.css",
"~/Content/site/my/sheet.less"));
In dev locally I end up with a link like this:
http://localhost:57240/Content/site/my/sheet.less
In release locally I end up with a link like this:
http://localhost:57240/Content/css/mySheet?v=zGP7kp7SWQZ0s2SVk555UPp3zcThPaRqzm6bTysZJzE1
But, when I deploy Release build to an Azure website (using Visual Studio publish mechanism) I end up with a link that looks like this:
http://mypage.azurewebsites.net/Content/css/mySheet?v=
As you can see the magic identifier is not appended to the end of the URL.
What gives?
It turns out I had two issues. The normalize.css file was not included in the project, and therefore not being deployed to Azure. The Less file was returning 404 in the Azure environment, but once it was set to Build Action="Content" it started working. I am not sure why this second thing worked, so I have posted another question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With