I'm running into some Medium trust issues with a few libraries. I'm able to reproduce the error with a sample and referencing that in my MVC probject. I'm trying to get pass this problem but don't understand what I'm missing.
I keep getting this error:
Inheritance security rules violated while overriding member: 'Temp.Class1.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
I think understand the security transparency error above, and I make sure my method is the same as the overriding method. Here is my class:
public class Class1 : MarshalByRefObject
{
[SecurityCritical]
public override object InitializeLifetimeService()
{
return null;
}
}
And I am still getting the same error as above.
Have been adding and removing this line with no effect:
[assembly: AllowPartiallyTrustedCallers()]
Reading other articles all I have to do is to add the SecurityCritical attribute to the method, but it does not seem to have any affect.
Any ideas, or something that I'm missing?