Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does a LESS file have to be set as Build Action "Content" to deploy to Azure?

I have an Azure website. I also have dotless running in my MVC app to translate and bundle Less files. When I deploy a release build to Azure, the Less file returns 404 unless I set it to Build Action="Content" in it's properties. Once I change that setting, everything works as expected.

So, I no longer have an issue, except I don't understand why it has to be set to Content. Can someone explain?

like image 979
RationalGeek Avatar asked Feb 26 '14 16:02

RationalGeek


1 Answers

Build Action="Content" tells the publishing process that this file should be copied as-is to the destination.

It's there so you don't bring along all your source files, readme files and other associated "developer fluff" when you're trying to publish the output of the build process. It's an opt-in process to make sure you don't bring anything sensitive by accident, like a private key.

Most item templates in Visual Studio set their Build Action to the right thing for you by default, generally so well that you don't even think about this until a template doesn't get this right and you wonder where your files are.

like image 139
Paul Turner Avatar answered Nov 15 '22 04:11

Paul Turner