Source InitializeLifetimeService Template

I am working on an application that will work with modules loaded from external assemblies. The only limitation of these modules is to inherit from the Module class so that the host calls them.

This class Module overrides InitializeLifetimeService so that the transparent proxy module does not overheat.

Now here is my problem: in .Net 4.0 code security, it is not allowed to partially override a method from a protected code (which is used by InitializeLifetimeService) to partially build trust. Since my template looks pretty common, I don’t understand how it is supposed that application hosting modules should interact with them.

Thanks.

+4
source share
1 answer

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

I assume that a module containing the class that you inherit may need to be updated with a new security attribute. Unfortunately, it looks like you are using a module that is not written by you, so you may need to talk to the module 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 SecuritySafeCritical or SecurityCritical."

-1
source

Source: https://habr.com/ru/post/1368914/


All Articles