views:

258

answers:

2

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?

A: 

Are they installed in the GAC?

Update: 2nd guess might be versioning issues.

leppie
Not in the GAC. How do I check for versioning issues? I've rebuilt the 2 projects but it still doesn't work.
izokurew
I think they are meant to be in the GAC. Thats the point of APTCA, AFAIK IIRC (hehe).
leppie
I don't want/need them to be in the GAC. The point is the COM is working perfectly when called from VFP, but for a reason that escape me, a C# project can't call it. Seem strange to me that VFP doesn't have any security issue at all while the .NET project is judged as unsafe.
izokurew
Are your assemblies signed?
leppie
Both of them, yes.
izokurew