本机装载的作品好。从.NET加载提示错误无法加载DLL“my.dll”:无效的内存位置访问 [英] Native loading works good. Loading from .net gives error Unable to load DLL 'my.dll': Invalid access to memory location

查看:902
本文介绍了本机装载的作品好。从.NET加载提示错误无法加载DLL“my.dll”:无效的内存位置访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用本机的dll,使用的DllImport。 我收到这样的错误。

I'm trying to use native dll, using DllImport. And I receive such error.

System.DllNotFoundException:无法加载DLLmy.dll:无效的内存位置访问。 (异常来自HRESULT:0x800703E6)

System.DllNotFoundException: Unable to load DLL 'my.dll': Invalid access to memory location. (Exception from HRESULT: 0x800703E6)

该DLL加载一般时,被称为从本地code (它是由德尔福的应用程序中使用)。 但是,当我从.NET code调用它,它给了我异常以上。

That dll loads normally when is called from native code (it is used from delphi app). But when I call it from .net code, it gives me exception above.

我读过这个链接<一个href="http://stackoverflow.com/questions/29284/windows-vista-unable-to-load-dll-x-dll-invalid-access-to-memory-location-dl">Windows Vista的:无法加载DLLx.dll:无效的内存位置访问。 (DllNotFoundException),但没有解决方案帮助。

I've read this link Windows Vista: Unable to load DLL 'x.dll': Invalid access to memory location. (DllNotFoundException), but no solution helps.

DEP,管理权限是不是这样的。

DEP, Administration rights are not the case.

P.S。出现这种情况的Windows 2008服务器上。在Win 2003服务器和XP一切都很正常。

P.S. This situation occurs on Windows 2008 server. On Win 2003 Server and XP everything works great.

推荐答案

看来我已经找到了问题。 问题是在DEP功能。 当我开启DEP为重要的方案而已,它给了没有效果。 但是,当我完全关闭DEP和重启的我的服务器,错误已经一去不复返了。 在一件事我做 - 已安装最新的更新的.NET 4.0

It seems I've found the problem. The problem was in DEP feature. When I switched on DEP for essential programs only, it gave no effect. But when I completely switched off DEP, and rebooted my server, error has gone. The one more thing I've done - installed latest updates for .net 4.0

这篇关于本机装载的作品好。从.NET加载提示错误无法加载DLL“my.dll”:无效的内存位置访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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