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
精彩评论