本文介绍了为什么一个LESS文件已被设置为构建动作"内容及QUOT;部署到Azure的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Azure的网站。我也有带点我的MVC应用程序翻译运行,并捆绑少的文件。当我部署一个发布版本天青,少文件返回404,除非我把它打造它的属性行动=内容。有一次,我改变设置,一切正常。

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?

推荐答案

建立行动=内容讲述了发布过程,这个文件应该被原样复制到目的地。

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.

在Visual Studio中的大多数项目模板设置其生成操作正确的事情,你在默认情况下,一般这么好,你甚至不考虑这个,直到模板不会得到这个权利,你不知道在您的文件

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.

这篇关于为什么一个LESS文件已被设置为构建动作"内容及QUOT;部署到Azure的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 23:15