How do I create/edit a Manifest file?

C#.NetVisual Studio-2010Visual Studio-2008Manifest

C# Problem Overview


I have this code from a coworker (probably got it from the web somewhere) but he's out on vacation and I need to add this to the manifest file

<?xml version="1.0" encoding="utf-8" ?> 
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" 
	xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" 
	xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <assemblyIdentity version="1.0.0.0" name="MyApplication" />
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
                <requestedExecutionLevel level="requireAdministrator" 
		uiAccess="false" />
            </requestedPrivileges>
        </security>
    </trustInfo>
</asmv1:assembly>  

I am relatively new to this so any help would be appreciated. Thanks

I'm using Visual Studio 2010

C# Solutions


Solution 1 - C#

In Visual Studio 2010 (until 2019 and possibly future versions) you can add the manifest file to your project.

Right click your project file on the Solution Explorer, select Add, then New item (or CTRL+SHIFT+A). There you can find Application Manifest File.

The file name is app.manifest.

Solution 2 - C#

As ibram stated, add the manifest thru solution explorer:

enter image description here

This creates a default manifest. Now, edit the manifest.

  • Update the assemblyIdentity name as your application.
  • Ask users to trust your application

enter image description here

  • Add supported OS

enter image description here

Solution 3 - C#

The simplest way to create a manifest is:

Project Properties -> Security -> Click "enable ClickOnce security settings" 
(it will generate default manifest in your project Properties) -> then Click 
it again in order to uncheck that Checkbox -> open your app.maifest and edit 
it as you wish.

Manifest location preview

Solution 4 - C#

In Visual Studio 2019 WinForm Projects, it is available under

Project Properties -> Application -> View Windows Settings (button)

enter image description here

Solution 5 - C#

Go to obj folder in you app folder, then Debug. In there delete the manifest file and build again. It worked for me.

Solution 6 - C#

In Visual Studio 2022 WinForm Project, it is also available under

Project Properties -> Application:

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCocoa DevView Question on Stackoverflow
Solution 1 - C#ibramView Answer on Stackoverflow
Solution 2 - C#Jim LahmanView Answer on Stackoverflow
Solution 3 - C#ssamkoView Answer on Stackoverflow
Solution 4 - C#Tejasvi HegdeView Answer on Stackoverflow
Solution 5 - C#IsaacView Answer on Stackoverflow
Solution 6 - C#Marcelo Scofano DinizView Answer on Stackoverflow