What purpose do unmanaged.dll.manifest files serve?

拈花ヽ惹草 提交于 2019-12-24 01:16:08

问题


I observe unmanaged.dll files having a unmanaged.dll.manifest file tagging along. On opening this files in an editor, it seems to be normal XML with links to certain other dependent managed? assemblies. This seems to be like a recent change.. don't remember seeing them earlier.

  • Why are these files needed? (If I had to make a guess, it would be to load dependent managed assemblies and/or the CLR)
  • What other useful information can these files contain? Would they contain any links to dependent unmanaged dlls too (which would be nice)

.

<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"></requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.DebugMFC" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>

回答1:


What you are seeing is called "Side-by-side assemblies" (SxS). Microsoft has extended the .NET side-by-side machinery to unmanaged DLLs, and now calls them "platform assemblies". Rather than performing linkage by DLL name, DLLs are now loaded through the manifest. The equivalent of the .NET GAC is the folder \windows\WinSxS; this allows simultaneous installation of multiple versions of the DLL on one system, and different applications binding against different versions of the same DLL. It also includes the redirection capabilities that .NET offers; this is primarily what the manifests do (allowing redirection).

The DLLs referred to in the manifest (e.g. Microsoft.VC90.DebugCRT) are also unmanaged (i.e. native code)

Application manifests serve other purposes as well. I don't know the details, but recall that selection of themes in XP is also indicated in manifests.



来源:https://stackoverflow.com/questions/348877/what-purpose-do-unmanaged-dll-manifest-files-serve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!