无法加载文件或程序集"MyDLL.dll"或其依赖项之一. [英] Could not load file or assembly 'MyDLL.dll' or one of its dependencies.

查看:98
本文介绍了无法加载文件或程序集"MyDLL.dll"或其依赖项之一.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在提供一个使用VS 2008 .NET 3.5构建/兼容的项目,目标平台设置为x86.该项目有2个C ++项目,这些项目已编译/内置到.dll中,并由整个项目中的C#winForm项目使用.

这个项目在开发站上可以正常运行,但是在我的机器VS 2010 .NET 4.0上可以构建,但是当我尝试运行它时,我一直在运行,期望它找不到C ++ .dll,它们是显然在项目中,它们的构建就很好.

这里发生了什么?我在这里缺少什么?

I''ve been giving a project that was built/complied with VS 2008 .NET 3.5 with the target platform set to x86. This project has 2 C++ project that are complied/built into .dll''s and used by a C# winForm project within the overall project.

This project builds and runs fine on the dev station but on my machine VS 2010 .NET 4.0 it builds but when I try to run it I keep getting run expections that it can''t find the C++ .dll''s and they are clearly in the project and they build just fine.

What''s going on here? What am I missing here?

推荐答案

右键单击您的dll引用.将本地副本"设置为True.

问候.
Right Click on your dll references. Set Local Copy to True.

Regards.


您可以使用Dependency Walker工具-它向您显示缺少依赖项的库.如果错过了mfc或任何Visual C ++运行时-安装Microsoft可再发行组件包(应该来自构建DLL的同一Visual Studio).另外,在这种情况下,您将不需要设置Visual C ++运行时,就可以设置到MFC或VC ++运行时库的静态链接(此配置在项目设置C/C ++->代码生成节点中-将MT用于Release,将MTd用于调试),在常规"项目选项卡上配置的MFC运行时.

问候,
Maxim.
You can use Dependency Walker Tool - it shows you what library in dependency is missing. If missed is mfc or any Visual C++ runtime - Install Microsoft redistributable package (should be from same Visual Studio on which you building the DLL). Also you can set the static linking to MFC or VC++ Runtime Libraries in that case you will no need to put Visual C++ runtime into setup (this configure in project settings C/C++ -> Code Generation node - use MT for Release and MTd for Debug), MFC runtime configured on General project tab.

Regards,
Maxim.


这篇关于无法加载文件或程序集"MyDLL.dll"或其依赖项之一.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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