Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
724 views
in Technique[技术] by (71.8m points)

visual-studio - Visual Studio项目属性中的各种“构建操作”设置是什么?它们的作用是什么?(What are the various “Build action” settings in Visual Studio project properties and what do they do?)

For the most part, you just take whatever Visual Studio sets it for you as a default... I'm referring to the BuildAction property for each file selected in Solution Explorer.

(在大多数情况下,您只需将Visual Studio为其设置的任何内容作为默认设置...我指的是在解决方案资源管理器中选择的每个文件的BuildAction属性。)

There are a number of options and it's difficult to know what each one of them will do.

(有很多选择,很难知道他们每个人会做什么。)

  ask by Gishu translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  • None : The file is not included in the project output group and is not compiled in the build process.

    ( :文件未包含在项目输出组中,并且未在构建过程中编译。)

    An example is a text file that contains documentation, such as a Readme file.

    (一个示例是包含文档的文本文件,例如自述文件。)

  • Compile : The file is compiled into the build output.

    (编译 :将文件编译到构建输出中。)

    This setting is used for code files.

    (此设置用于代码文件。)

  • Content : Allows you to retrieve a file (in the same directory as the assembly) as a stream via Application.GetContentStream(URI).

    (内容 :允许您通过Application.GetContentStream(URI)检索文件(与程序集在同一目录中)作为流。)

    For this method to work, it needs a AssemblyAssociatedContentFile custom attribute which Visual Studio graciously adds when you mark a file as "Content"

    (要使此方法起作用,它需要一个AssemblyAssociatedContentFile自定义属性,当您将文件标记为“内容”时,Visual Studio会轻松添加该属性)

  • Embedded resource : Embeds the file in an exclusive assembly manifest resource.

    (嵌入式资源 :将文件嵌入独占程序集清单资源中。)

  • Resource (WPF only) : Embeds the file in a shared (by all files in the assembly with similar setting) assembly manifest resource named AppName.g.resources.

    (资源 (仅限WPF) :将文件嵌入共享(由具有类似设置的程序集中的所有文件)组件清单资源,名为AppName.g.resources。)

  • Page (WPF only) : Used to compile a xaml file into baml .

    (Page (仅限WPF) :用于将xaml文件编译为baml 。)

    The baml is then embedded with the same technique as Resource (ie available as `AppName.g.resources)

    (然后使用与Resource相同的技术嵌入baml (即可用作'AppName.g.resources))

  • ApplicationDefinition (WPF only) : Mark the XAML/class file that defines your application.

    (ApplicationDefinition (仅限WPF) :标记定义应用程序的XAML /类文件。)

    You specify the code-behind with the x:Class="Namespace.ClassName" and set the startup form/page with StartupUri="Window1.xaml"

    (使用x:Class =“Namespace.ClassName”指定代码隐藏,并使用StartupUri =“Window1.xaml”设置启动表单/页面)

  • SplashScreen (WPF only) : An image that is marked as SplashScreen is shown automatically when an WPF application loads, and then fades

    (SplashScreen (仅限WPF)WPF应用程序加载后会自动显示标记为SplashScreen的图像, 然后逐渐消失)

  • DesignData : Compiles XAML viewmodels so that usercontrols can be previewed with sample data in Visual Studio (uses mock types)

    (DesignData :编译XAML视图模型,以便可以在Visual Studio中使用示例数据预览用户控件(使用模拟类型))

  • DesignDataWithDesignTimeCreatableTypes : Compiles XAML viewmodels so that usercontrols can be previewed with sample data in Visual Studio (uses actual types)

    (DesignDataWithDesignTimeCreatableTypes :编译XAML视图模型,以便可以使用 Visual Studio中的示例数据预览用户控件(使用实际类型))

  • EntityDeploy : (Entity Framework) : used to deploy the Entity Framework artifacts

    (EntityDeploy :( 实体框架)用于部署Entity Framework工件)

  • CodeAnalysisDictionary : An XML file containing custom word dictionary for spelling rules

    (CodeAnalysisDictionary :包含拼写规则的 自定义单词字典的XML文件)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...