unmanaged.dll.manifest文件有什么用途? [英] What purpose do unmanaged.dll.manifest files serve?

查看:83
本文介绍了unmanaged.dll.manifest文件有什么用途?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我观察到同时带有标记为unmanaged.dll.manifest的unmanaged.dll文件.在编辑器中打开此文件时,似乎是正常的XML,带有指向某些其他从属托管链接的链接?程序集.这似乎是最近的变化..不记得更早看到它们了.

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.

  • 为什么需要这些文件? (如果我不得不猜测,那就是加载依赖的托管程序集和/或CLR)
  • 这些文件还可以包含哪些其他有用信息?它们是否也包含指向依赖的非托管dll的任何链接(这会很好)

.

<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>

推荐答案

您看到的被称为"并排程序集"(SxS). Microsoft已将.NET并行机制扩展到非托管DLL,现在将它们称为平台程序集".现在不再通过DLL名称执行链接,而是通过清单加载DLL. .NET GAC的等效项是文件夹\ windows \ WinSxS;.这样就可以在一个系统上同时安装DLL的多个版本,并且可以将不同的应用程序绑定到同一DLL的不同版本.它还包括.NET提供的重定向功能.这主要是清单工作(允许重定向).

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).

清单中引用的DLL(例如Microsoft.VC90.DebugCRT)也不受管理(即本机代码)

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

应用程序清单也可用于其他目的.我不知道细节,但记得在清单中也指出了XP中的主题选择.

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.

这篇关于unmanaged.dll.manifest文件有什么用途?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆