开发者

SecurityException: That assembly does not allow partially trusted callers

开发者 https://www.devze.com 2022-12-10 02:26 出处:网络
From a C# WinForm project, I want to call a .NET COM method that already exist. I\'ve added the reference 开发者_运维问答to the COM, but I can\'t get rid of the SecurityException \"That assembly does

From a C# WinForm project, I want to call a .NET COM method that already exist. I've added the reference 开发者_运维问答to the COM, but I can't get rid of the SecurityException "That assembly does not allow partially trusted callers".

Both projects are strongly named. I've added [assembly: AllowPartiallyTrustedCallers] at the top of the COM project, but it still crash when I try to call the public method.

What step did I miss?


Are they installed in the GAC?

Update: 2nd guess might be versioning issues.


I found the solution. It's explained here http://www.c-sharpcorner.com/UploadFile/psingh/CallingCOMComponentFromCSharp12022005231615PM/CallingCOMComponentFromCSharp.aspx

0

精彩评论

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