C#中无法加载DLL(模块找不到HRESULT:0x8007007E) [英] C# Unable to load DLL (Module could not be found HRESULT: 0x8007007E)

查看:4463
本文介绍了C#中无法加载DLL(模块找不到HRESULT:0x8007007E)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:无法加载DLL x.dll:指定的模块找不到。 (从HRESULT异常:0x8007007E)

error:Unable to load DLL 'x.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

操作系统:Windows 7

OS: Windows 7

我有两个站时,Visual Studio 2012,使用.NET 4.0;其他没有安装VS 在第一站VS2012我有进口的C ++项目C#的解决方案。 我使用的:

I have two stations, Visual Studio 2012, using .net 4.0; the other don't have VS installed On the first station with VS2012 I have a C# solution with a C++ project imported. I'm using:

    [DllImport("x.dll", CallingConvention = CallingConvention.Cdecl)]
    [return: MarshalAs(UnmanagedType.I4)]

在此站工作。

但是,当我提出的其它站(没有安装VS)上出现了错误。 如果我安装VS,它的工作。

But when I moved on the other station (that don't have VS installed) it appear that error. If I install VS, it's working.

什么是一些可能的原因出现这个问题?什么任何想法我可能会丢失或我怎么能调试这个问题?

What are some possible reasons for this problem to occur? Any ideas on what I could be missing or how I could debug this problem?

推荐答案

最可能的原因是,它没有安装Visual Studio中的机器却丢失需要由非托管的DLL的C ++运行时。安装从下载可再发行相应的C ++运行时。

The most likely reason is that the machine which does not have Visual Studio installed is missing the C++ runtime that is needed by your unmanaged DLL. Install the appropriate C++ runtime from the downloadable redistributable.

请确保您的非托管的DLL链接对发布运行,而不是调试运行时。后者不能被重新分配。

Do make sure that your unmanaged DLL is linked against the release runtime and not the debug runtime. The latter cannot be redistributed.

您可以使用调试工具,如Dependency Walker中托管的DLL依赖问题,过程监控等。

You can debug unmanaged DLL dependency issues using tools like Dependency Walker, Process Monitor etc.

这篇关于C#中无法加载DLL(模块找不到HRESULT:0x8007007E)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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