今天用 VS 2005 写了一段Remoting的代码。运行总是报错,错误信息如下:
FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x7f5350c6, on thread 0x12a0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

把一些以前可以运行的代码拿出来运行,还是这样的错误。

在另一台机子上运行,没有问题!

在网上查了一下资料,发现是微软的一个bug,微软在下面的网址进行了反馈:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=284215

Thank you very much for this bug report. The issue repros only when using custom marshaling with arrays on 64-bit and on Vista or on machines with the recent .NET Framework update. It will be fixed in an upcoming servicing release. In the meantime, a workaround is to use 'object' instead of an array in interop method signatures.

Ladi Prosek,
CLR team
Microsoft 在 2007/7/27 19:02 发送

晕~~等到何年何月。

似乎这个bug是在x64操作系统上的问题,难道真要等下一个版本???

再找了一下资料,貌似这个问题是因为这样引起的

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=382483&SiteID=1
 

I spend a few hours on this and It's because your using a x86 dll on a x64 exe.

Switch your exe to x86 and it should run.

Or make them both x64.
---------------------------------------------------------------------------------------
but how to switch??????????
在VS里找,发现在工程属性里的build tag页,有选择Platform target这么一项。把选项选为x86。

重新编译,程序就可以正常运行了!

posted on 2007-08-03 19:48  Jason Li 2011  阅读(1219)  评论(0编辑  收藏  举报