Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Declaring Manifest for Multi-Platform Environment

Tags:

c#

manifest

I am modifying the manifest of a C# project that has been built a long time ago for x86 architecture platforms (win32) to work on both 64 and 32 bit machines.

Here is the original 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="app.exe" processorArchitecture="X86" type="win32"/>
   <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>

What I couldn't find is how to get both X86 and X64 (win32 and win64) to work in the processorArchitecture and type fields?

like image 511
sonne Avatar asked Dec 04 '25 05:12

sonne


1 Answers

You can use

processorArchitecture="*"

to indicate support for all architectures.

If your application is a 32 bit application then you can use

processorArchitecture="x86"

With such a manifest your process will be just fine on a 64 bit system since it will be running as a 32 bit process under the WOW64 emulator.

For a 64 bit application running on x64 you use

processorArchitecture="amd64"

And finally, for 64 bit Itanium the value is

processorArchitecture="ia64"

For the type attribute, the value is always type="win32".

The documentation (which is admittedly a little sparse) is here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa374191.aspx

For what it is worth, it doesn't seem to me as though you need to change anything. If you have a 32 bit executable built with a processorArchitecture="x86" manifest then that executable is already configured perfectly for both 32 and 64 bit systems. Remember that it is the architecture of the process that counts here, and not the architecture of the system that runs the process. Your 32 bit executable runs as a 32 bit process even on a 64 bit system.

like image 53
David Heffernan Avatar answered Dec 05 '25 22:12

David Heffernan