构建 C# 应用程序的发布版本 [英] Building Release Version of a C# application

查看:53
本文介绍了构建 C# 应用程序的发布版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studios 中构建我的 C# 应用程序的发布版本时,它还生成了一个 .config 和一个 .manifest 文件.我想知道这些是什么以及它们是否对应用程序的实际运行很重要.

When Building a release version of my C# application in Visual Studios, it also produced a .config and a .manifest file. I was wondering what these were and if they are important to the actual running of the application.

推荐答案

阅读:

什么是清单文件:

清单是一个 XML 文档,可以是外部 XML 文件,也可以是嵌入在应用程序或程序集中的资源.隔离应用程序的清单用于管理应用程序在运行时应绑定到的共享并行程序集的名称和版本.并行程序集的清单指定其对名称、版本、资源和其他程序集的依赖关系.

A manifest is an XML document that can be an external XML file or a resource embedded inside an application or an assembly. The manifest of an isolated application is used to manage the names and versions of shared side-by-side assemblies to which the application should bind at run time. The manifest of a side-by-side assembly specifies its dependencies on names, versions, resources, and other assemblies.

如何控制它:

默认情况下,新项目的项目属性设置为生成一个清单文件.但是可以禁用清单的生成对于使用项目的 Generate Manifest 属性的项目.当这属性设置为 Yes,将生成此项目的清单.除此以外链接器在解析依赖项时忽略程序集信息应用程序代码,并且不生成清单.

By default the project properties of new projects are set to generate a manifest file.However it is possible to disable generation of the manifest for a project using the Generate Manifest property of the project. When this property is set to Yes, the manifest for this project is generated. Otherwise the linker ignores assembly information when resolving dependencies of the application code, and does not generate the manifest.

Visual Studio 中的构建系统允许将清单嵌入到最终二进制应用程序文件,或作为外部文件生成.这种行为是由项目属性"对话框中的嵌入清单"选项控制.要设置此属性,请打开 Manifest Tool 节点,然后选择 Input and Output.如果清单未嵌入,则将其生成为外部文件并保存在与最终二进制文件相同的目录中.如果清单被嵌入,Visual Studio 嵌入最终清单.

The build system in Visual Studio allows the manifest to be embedded in the final binary application file, or generated as an external file. This behavior is controlled by the Embed Manifest option in the Project Properties dialog. To set this property, open the Manifest Tool node, then select Input and Output. If the manifest is not embedded, it is generated as an external file and saved in the same directory as the final binary. If the manifest is embedded, Visual Studio embeds the final manifests.

取自此处

此外,您可以从这里控制它.项目属性>>应用程序标签

also, you can control it from here. Project Properties>>Application tab

这篇关于构建 C# 应用程序的发布版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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