问题描述
好的,在进行了大量研究并尝试了几乎所有我能找到的托管 CPP Redist 以及尝试将我的 DLL 本地复制到应用程序的执行目录之后,我无法弄清楚我缺少哪些依赖项.模式库.
Alright, after doing a ton of research and trying almost every managed CPP Redist I can find as well as trying to copy my DLLs locally to the executing directory of the app I cannot figure out what dependencies i'm missing for this mixed mode library.
基本上我有一个大型 C# 应用程序,我正在尝试使用我制作的混合模式库.在开发机器上它可以完美运行(当然),但在需要加载库以供使用时部署它会因为缺少 CRT 依赖项而出现异常(我假设).
Basically I have a large C# application and I'm trying to use a mixed mode library I made. On the development machine it works perfect (of course) but deployed when the library needs to be loaded for use it exceptions out because of missing CRT dependencies (I assume).
我已经使用依赖项遍历器检查所有引用的 DLL,并确保它们存在于部署机器上,但没有运气,我想知道是否可能是我缺少一些需要注册的依赖项,但我不能弄清楚什么.
I have used dependency walker to check all the DLLs referenced and ensured they exist on the deployment machine with no luck, I'm wondering if maybe it's some dependencies that need to be registered that I am missing, but i can't figure out what.
当代码尝试从混合模式库中实例化一个类时,出现以下异常.
I get the following exception when code tries to instantiate a class from the mixed mode library.
异常详情:System.IO.FileLoadException:不能加载文件或程序集'USADSI.MAPI,版本=1.0.3174.25238,文化=中立,PublicKeyToken=null'或其依赖项之一.这应用程序无法启动因为应用程序配置是不正确的.重新安装应用程序可能会解决此问题.(HRESULT 异常:0x800736B1)
Exception Detail: System.IO.FileLoadException: Could not load file or assembly 'USADSI.MAPI, Version=1.0.3174.25238, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
我正在使用 VS2008 SP1 编译库,并指定了/clr:oldSyntax.
I am compiling the library using VS2008 SP1 with /clr:oldSyntax specified.
中间清单如下所示:
<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.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
我可以根据需要提供更多信息,不幸的是我不精通混合模式库的制作,所以这让我很失望.
I can provide any more information as needed, unfortunately i'm not well versed in making mixed mode libraries so this has thrown me off.
如果有人能提供任何建议,我将不胜感激!
If anyone can offer any advice I would greatly appreciate it!
推荐答案
你部署了CRT 库 在目标机器上?远景:由于您依赖于 32 位代码,因此您应该将 Build 属性选项卡中的 Target Platform 设置为 x86.
Did you deploy the CRT libraries on the target machine? Long shot: since you have a dependency on 32-bit code, you should set Target Platform in the Build property tab to x86.
使用 Sxstrace.exe 实用程序,在 Vista 上可用.
trouble-shoot side-by-side resolving problems with the Sxstrace.exe utility, available on Vista.
这篇关于混合模式库和 CRT 依赖项 - 帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!