What is "Hostprotectionattribute" in SQL Server 2005?

As said previously .NET 2.0 provides capability to host itself and that's how SQL Server interacts with the framework. But there should be some mechanism by which the host who is hosting .NET assemblies should be alerted if there is any out of serious code running like threading, synchronization etc. This is what exactly the use of "Hostprotectionattribute". It acts like a signal to the outer host saying what type of code it has. When .NET Framework 2.0 was in development Microsoft tagged this attribute on many assemblies , so that SQL Server can be alerted to load those namespaces or not. Example if you look at System.Windows you will see this attribute.
So during runtime SQL Server uses reflection mechanism to check if the assembly has valid protection or not.

0 comments:

Post a Comment

Blogger news