How to embed a manifest file at compile time in Visual Studio 2010

安稳与你 提交于 2019-11-27 20:42:05

In Visual Studio 2010 the default setting for a new project is to embed the manifest in the application (option #1). By default though a default manifest is included. What you need to do is add a custom manifest.

  • Right click on the project and select "Add New Item"
  • Select "Application Manifest File"

This will add a file named app.manifest to the project. Open that file and modify the line to be the following

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

This should also work in Visual Studio 2008.

Under VS2010 it is a little different. Right click the Project and select Properties. Select the "Application" tab and then click "View Windows Settings". This opens the manifest. Then make the changes you need.

Jay

I just ran into the same problem caused by copying an existing app.manifest into another project (C#).

I fixed it by unloading the project, editing its csproj file and inserting the following section:

<PropertyGroup>
  <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

This allowed my application to pick up the app.manifest correctly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!