什么是Visual Studio内容生成操作? [英] What is Content Build Action in Visual Studio?

查看:333
本文介绍了什么是Visual Studio内容生成操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么的内容的生成操作在Visual Studio中吗?它看起来并不像它做任何事情。

What does Content Build Action in Visual Studio do? It does not look like it's doing anything.

文件属性文章MSDN说:

内容 - 该文件不会被编译,而是包含在内容输出小组。例如,该设置是.htm或其他类型的Web文件的默认值。

Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file.

但我不知道什么是内容输出组的意思。

But I have no idea what "Content output group" means.

这是一些关于部署?含义的动作时建立的,但后来才进行部署时没有实际效果?

Is this something about deployment? Meaning the action has no actual effect when building, but only later when deploying?

推荐答案

在一些测试,并与<暗示href=\"http://stackoverflow.com/questions/145752/what-are-the-various-build-action-settings-in-vs-net-project-properties-and-wh\">What是各种&QUOT;建立行动&QUOT;在VS.NET项目属性,哪些设置做他们做?我发现的内容的行动建立在WPF项目只(可能太ASP)的影响。

After some testing and with hint from What are the various "Build action" settings in VS.NET project properties and what do they do? I've found that the Content build action has effect in WPF projects only (possibly ASP too).

它增加了

[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("filename")]

WpfApplication1_Content.g.cs 。阅读关于<一个href=\"http://msdn.microsoft.com/en-us/library/system.windows.resources.assemblyassociatedcontentfileattribute.aspx\"><$c$c>AssemblyAssociatedContentFileAttribute.

在控制台或WinForms的应用,不会做任何事情(无论是在源$ C ​​$ C和输出二进制)。

In console or WinForms applications it does not do anything (neither in source code nor output binary).

虽然在<一href=\"http://stackoverflow.com/questions/145752/what-are-the-various-build-action-settings-in-vs-net-project-properties-and-wh#comment29008347_145769\">comment,以previously提到的问题,有笔记有关部署的效果:

Though in comment, to previously mentioned question, there's note about effect on deployment:

另外请注意使用时的内容将包括一键式部署的,但没有也不会即使副本,如果新的被选中。

Also note that Content will be included when using one-click deploy, but None won't even if "copy if newer" is selected.

也许这个作品甚至控制台和WinForms应用程序(我没试过)。

Possibly this works even for console and WinForms applications (I haven't tried).

这篇关于什么是Visual Studio内容生成操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆