"Error creating activation context" with an attempt to add an application manifest

I am trying to add an application manifest that requires enhancement in my .NET 2.0 EXE. I did this for a simple EXE, and it worked without problems, but it does not work on this more complex EXE.

My EXE has a configuration file and many dependencies on other DLLs in my solution.

When I run the EXE, I get a SideBySide error saying " Activation context generation failed for "C:\MyCompany.MyProduct.WinUI.exe".Error in manifest or policy file "C:\MyCompany.MyProduct.WinUI.exe.Config" on line 1. Invalid Xml syntax. "

What does my configuration file do with the manifest file? Here is my manifest:

 <?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="2.10.0.0" name="MyCompany.MyProduct.WinUI"/> <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> 
+6
manifest side-by-side
source share
3 answers

I have found a solution.

The encoding specified in MyCompany.MyProduct.WinUI.exe.Config is not supported.

 <?xml version="1.0" encoding="iso-8859-1"?> 

I changed the encoding to utf-8 and everything works fine ...

 <?xml version="1.0" encoding="utf-8"?> 
+9
source share

You have not closed the asmv1: assembly tag.

Also, try downloading XML Notepad and loading your XML into it. This tells you very well what you did wrong.

+3
source share

my problem is that I had the wrong XML in my application, Config, the application configuration item closing two quotes β†’ ""

as soon as I deleted the second β†’ "my console application was working fine, error no doute.

0
source share

All Articles