如何使用 VS2008 将应用程序清单嵌入到应用程序中? [英] How can I embed an application manifest into an application using VS2008?

查看:26
本文介绍了如何使用 VS2008 将应用程序清单嵌入到应用程序中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读此处此处 了解将我的应用程序的清单文件嵌入 PE 中的方法,但这些步骤似乎不适用于 VC#:VS2008 - VS2008 甚至没有附带 mt.exe(据我所知)

I've read here and here for ways to embed my application's manifest files inside the PE but these steps do not seem to work for VC#:VS2008 - VS2008 doesn't even come with mt.exe (as far as i know)

我该怎么做?

推荐答案

您可以按照以下步骤向 C# 应用程序添加清单:

  1. 在解决方案资源管理器中右键单击您的项目
  2. 从上下文菜单中选择添加新项目".
  3. 从出现的对话框的选项列表中选择应用程序清单文件".

但是,请注意,Visual Studio 默认已将清单添加到您的项目中,以确保符合 Windows Vista 和 7 中的 UAC.如果您想指定您的项目应使用自定义清单文件而是按照以下附加步骤操作:

However, note that Visual Studio already adds a manifest to your project by default in order to ensure compliance with UAC found in Windows Vista and 7. If you want to specify that a custom manifest file should be used by your project instead, follow these additional steps:

  1. 将自定义清单文件添加到项目后,在解决方案资源管理器中右键单击您的项目,然后单击属性"(或双击项目下的属性"项).
  2. 在第一个选项卡(应用程序")下,您应该会看到一组选项,用于指定您的应用程序如何管理资源.您可以选择默认的图标和清单"选项,但您需要从标有清单"的下拉框中选择您的自定义清单文件.

最后,为了完整性或者如果上述步骤对您不起作用,您仍然可以使用 mt.exe 将清单文件嵌入到应用程序的 EXE 中.如果安装的 Visual Studio 中未包含它,则需要下载并安装 Windows SDK.获取适用于 Windows 7 和 .NET Framework 4.0 的最新版本 此处.

Finally, for the sake of completeness or if the above steps don't work for you, you can still use mt.exe to embed your manifest file into your application's EXE after you've built it. If it wasn't included with your installation of Visual Studio, you'll need to download and install the Windows SDK. Get the latest version for Windows 7 and the .NET Framework 4.0 here.

这篇关于如何使用 VS2008 将应用程序清单嵌入到应用程序中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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