开发者

InitializeLifetimeService overriding pattern

I'm working on an app that will work with modules loaded from external assemblies. Those modules' only constraint is to inherit from a Module class in order for the host to call them.

This Module class overrides InitializeLifetimeService in or开发者_开发知识库der for the module's transparent proxy not to timeout.

Now here's my problem: in .Net 4.0's code security, it is not allowed for a Partial Trust assembly to override a method from Secure code (which InitializeLifetimeService is). Since my pattern looks pretty common, I don't understand how an app hosting modules is supposed to communicate with them.

Thanks.


Maybe this link can help you: http://msdn.microsoft.com/en-us/library/dd233102.aspx#inheritance

My guess is that the module that contains the class you inherit from may need to be updated with a new security attribute. Unfortunately it sounds like you are using a module that isn't written by you, so you may need to talk to the module's author, or company.

From MSDN "Virtual and abstract methods that are introduced in base classes or interfaces, and overridden or implemented in a security-critical class are transparent by default. They must be identified as either SecuritySafeCritical or SecurityCritical."

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜