Caverman
Caverman

Reputation: 3707

LESS not compiling on Windows 2012 server?

This is my first time to use LESS in a project and it's not working when I publish to a server. Everything works fine when I run it locally in Visual Studio.

I'm running it in an MVC 5 application and after I was done I used Visual Studio to publish the files to a local folder. Then I copied the files over to the server. Initially the VS publish converted my Site.less file to Site.css and I figured that was the problem. So I researched and found that I could set the properties of the Site.less file's BuildAction=Content. Then the publishing locally created the Site.less instead of Site.css. However, when I copy that to the server the CSS isn't applied and when I browse to site.com/content/site.less I'm getting an error as though it's not compiling.

Looking around some more I found where someone said I had to set the MIME type in IIS but they didn't mention what the MIME time should be.

What do I need to do on the server get it my CSS to apply when using LESS?

Upvotes: 1

Views: 57

Answers (1)

Ron Brogan
Ron Brogan

Reputation: 901

Your server shouldn't compile LESS->CSS when your app is published. Your app should contain your css/min.css when published, not just your LESS file(s).

Upvotes: 1

Related Questions