MT.exe is used to embed the manifest inside the final DLL to guarantee correct runtime behavior. There is a specific scenario where final DLL size is zero after embedding the manifest. This issue happens on XP/Win server 2003 x64 bit machines while using local C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\bin\mt.exe to embed manifest into the DLL, where manifest file and the DLL are present on network share. This behavior can be seen only when the input DLL size is greater than ~32 MB.
Environment:
Window XP x64
Windows Server 2003 x64
Mt.exe Version:
C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\bin>mt -?
Microsoft (R) Manifest Tool version 6.0.4071.0
Copyright (c) Microsoft Corporation 2004.
All rights reserved.
Repro Steps:
1. Take any DLL compiled with Visual Studio 2005 whose size exceeds 32 MB. Say the name of the DLL is Test.DLL. Make sure that manifest is not
embed in the DLL.
2. Copy Test.DLL and following Test.DLL.Manifest on to some network share, say \\NetworkShare\Test
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='amd64' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
3. Now go to XP/Win 2003 server x64 where you have Visual Studio 2005 installed and map a network drive, say Z:\ to \\NetworkShare\Test
4. Run the following command,
Z:\Test>"C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\bin\mt.exe" -manifest Test.dll.manifest -outputresource:Test.dll;2
Expected output:
Test.dll of size ~32 MB
Actual output:
Test.dll of size 0 bytes
Environment:
Window XP x64
Windows Server 2003 x64
Mt.exe Version:
C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\bin>mt -?
Microsoft (R) Manifest Tool version 6.0.4071.0
Copyright (c) Microsoft Corporation 2004.
All rights reserved.
Repro Steps:
1. Take any DLL compiled with Visual Studio 2005 whose size exceeds 32 MB. Say the name of the DLL is Test.DLL. Make sure that manifest is not
embed in the DLL.
2. Copy Test.DLL and following Test.DLL.Manifest on to some network share, say \\NetworkShare\Test
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='amd64' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
3. Now go to XP/Win 2003 server x64 where you have Visual Studio 2005 installed and map a network drive, say Z:\ to \\NetworkShare\Test
4. Run the following command,
Z:\Test>"C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\bin\mt.exe" -manifest Test.dll.manifest -outputresource:Test.dll;2
Expected output:
Test.dll of size ~32 MB
Actual output:
Test.dll of size 0 bytes