csproj中不同的构建操作会执行什么操作. IE.附加文件或伪造 [英] What do the different build actions do in a csproj. I.e. AdditionalFiles or Fakes

查看:65
本文介绍了csproj中不同的构建操作会执行什么操作. IE.附加文件或伪造的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Web API项目中不同的构建动作有什么作用(可能也适用于其他类型)?

What do the different build actions do in a Web API project (may apply to other types as well)?

我看到:无,编译,内容,嵌入式资源,AdditionalFiles,CodeAnalysisDictionary,ApplicationDefinition,页面,资源,SplashScreen,DesignData,DesignDataWithDesignTimeCreatableTypes,EntityDeploy,XamlAppDef,伪造品

I see: None, Compile, Content, Embedded Resource, AdditionalFiles, CodeAnalysisDictionary, ApplicationDefinition, Page, Resource, SplashScreen, DesignData, DesignDataWithDesignTimeCreatableTypes, EntityDeploy, XamlAppDef, Fakes

我在StackOverflow上发现了类似的问题,但是它们没有链接到任何Microsoft文档或包含所有项目.即,AdditionalFiles或Fakes是做什么的?

I found similar questions on StackOverflow, but they don't link to any Microsoft documentation or contain all items. I.e., what does AdditionalFiles or Fakes do?

"Visual Studio项目属性中的各种生成操作"设置是什么,它们是做什么的?" 列表不完整.

是的,我确实在文档中查找并找不到它.

Yes, I did look and can't find it in the documentation.

推荐答案

这些属性没有集中的文档.其原因是该列表是可扩展的,每种Visual Studio Project类型都可以提供自己的列表.这也意味着下拉菜单的内容会根据您已安装的Visual Studio有效负载,扩展名,所使用的编程语言等而发生变化.

There is no centralized documentation on these properties. The reason for it is that this list is extensible, each Visual Studio Project type can supply it's own. This also means that the contents of the drop-down changes depending on what Visual Studio payloads you have installed, which extensions, what programing language you're using etc.

这是如何将其扩展以进行代码分析的示例:

This is an example of how this is extended for Code Analysis:

<!-- Make AdditionalFiles and CodeAnalysisDictionary available as a Build Action in Visual Studio -->
<ItemGroup>
  <AvailableItemName Include="AdditionalFiles" />
  <AvailableItemName Include="CodeAnalysisDictionary" />
</ItemGroup>

其他内容可以通过爬MsBuild目标文件夹找到,每个都通过.target文件中的AvailableItemName项注册.

The others can be found by crawling the MsBuild targets folder, each is registered through AvailableItemName items in the .target files.

  • 无,
  • 编译-将文件传递到属于项目类型的编译器
  • 内容-将文件标记为内容,并可以选择将它们复制到输出目录
  • 嵌入式资源-用于将内容作为资源嵌入到驴子中
  • AdditionalFiles-由代码分析功能使用.在Microsoft.CodeAnalysis.Targets中定义
  • CodeAnalysisDictionary-由代码分析功能FxCop和Roslyn使用.在Microsoft.CodeAnalysis.Targets中定义
  • ApplicationDefinition-在Microsoft.Winfx.targets中定义
  • 页面-在Microsoft.Winfx.targets中定义
  • 资源-在Microsoft.Winfx.targets中定义
  • SplashScreen-在Microsoft.Winfx.targets中定义
  • DesignData-在Microsoft.Winfx.targets中定义
  • DesignDataWithDesignTimeCreatableTypes-在Microsoft.Winfx.targets中定义
  • EntityDeploy-在Microsoft.Data.Entity.targets中定义
  • XamlAppDef-在Microsoft.Winfx.targets和Microsoft.Xaml.targets中定义
  • Fakes-由Fakes框架(Visual Studio Enterprise的一部分)使用.一个框架,允许编写可以绕过静态,内部和私有API的测试.
  • None,
  • Compile - Passes the files to the compiler that belongs to the project type
  • Content - Marks files as content and optionally copies them to the output directory
  • Embedded Resource - Used to embed content into asseblies as resource
  • AdditionalFiles - Used by Code Analysis features. Defined in Microsoft.CodeAnalysis.Targets
  • CodeAnalysisDictionary - Used by Code Analysis features, FxCop and Roslyn. Defined in Microsoft.CodeAnalysis.Targets
  • ApplicationDefinition - Defined in Microsoft.Winfx.targets
  • Page - Defined in Microsoft.Winfx.targets
  • Resource - Defined in Microsoft.Winfx.targets
  • SplashScreen - Defined in Microsoft.Winfx.targets
  • DesignData - Defined in Microsoft.Winfx.targets
  • DesignDataWithDesignTimeCreatableTypes - Defined in Microsoft.Winfx.targets
  • EntityDeploy - Defined in Microsoft.Data.Entity.targets
  • XamlAppDef - Defined in Microsoft.Winfx.targets and Microsoft.Xaml.targets
  • Fakes - Used by the Fakes framework (part of Visual Studio Enterprise). A framework which allows writing tests that can bypass static, internal and private API's.

我的系统在您发布的系统之上还有一些额外的系统.您需要在文档中搜索每种项目类型的含义.根据其来源,您可能需要查看第三方系统的文档.

My system has a few extra ones on top of the ones you've posted. You'll need to search the docs for each project type for the meaning. Depending on their source you may need to look at the docs of 3rd party systems.

MsBuild的可扩展性使其成为一个功能非常强大的系统,同时有时使弄清事物为何如此的梦night以求.我一直坚持这样的推理:如果我不知道这意味着什么,那么我可能就不需要它了……".

The extensibility of MsBuild makes it a very powerful system, at the same time it sometimes makes it nightmarish to figure out why things are the way they are. I've kept to the reasoning: "If I don't know what it means, I probably won't need it...".

这篇关于csproj中不同的构建操作会执行什么操作. IE.附加文件或伪造的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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