I have written an assembly which is integrated in sql server, providing some stored procedures written in C#. The assembly has a readonly static variable holding some configuration data. This data is manipulated via stored procedures, which are also provided by the assembly. Obviously I have to synchronize access to this static variable. I tried to use
lock(someGuard)
{
// ... access static configuration
}
inside my configuration class. But then I get a HostProtectionException, telling me, that the assembly has to run with full trust to do that. Is there a better way to do that?