1
我想在Visual Studio 2008下编译一个依赖于msvcr90.dll作为私有程序集的DLL(基本上我会将这个DLL转储到与我的应用程序相同的目录中),而无需外部清单文件。如何编译不需要外部清单文件的DLL?
我跟着http://msdn.microsoft.com/en-us/library/ms235291.aspx 部“部署的Visual C++库的DLL为专用程序集”但 而不是使用外部清单文件(即 Microsoft.VC90.CRT.manifest)我想介绍的步骤以某种方式将其嵌入到DLL中。
如果我将Microsoft.VC90.CRT.manifest嵌入msvcr90.dll或DLL加载它,并删除外部清单文件,LoadLibrary()失败。
问题是,当你嵌入清单成一个DLL,它实际上嵌入如下:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false">
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
</dependentAssembly>
</dependency>
</assembly>
我觉得< dependentAssembly>行是什么导致它,如果 清单文件丢失死亡。有任何想法吗?