开发者

"Attempted to read or write protected memory" error when accessing COM component from C#

开发者 https://www.devze.com 2023-03-02 12:43 出处:网络
I have an ASP.NET application which uses an old and now unsupported third party COM component. The Application runs reliably on windows serv开发者_开发技巧er 2003, but when I try to run it on 2008 r2

I have an ASP.NET application which uses an old and now unsupported third party COM component. The Application runs reliably on windows serv开发者_开发技巧er 2003, but when I try to run it on 2008 r2 or windows 7, I get the above message. Obviously i've switched the application pool into 32 bit mode.

I realise I will eventually need to replace this with a new component but for the moment I'm just trying to get this legacy app working in the new environment. I can change the C# code that calls it but I can't change the COM component itself.

any thoughts gratefully received

Andy


Try compiling your ASP.Net application targeting the x86 platform.

Edit:

Also when you recompile I would make sure to grab the new Interop it creates in relation to your COM component.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号