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

a 夏天 提交于 2019-12-08 20:41:06

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/22047068/why-does-a-less-file-have-to-be-set-as-build-action-content-to-deploy-to-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!