Is XmlTextReader marked with HPA

Hi all,

I want to know if the System.Xml.XmlTextReader is marked with Host Protection Attributes(HPA) in the SQL Server 2005 CLR. I ask this because when I add a custom class that inherits from System.Xml.XmlTextReader, I get a code access security error at runtime. I am able to register the assembly just fine. I have tested it with all the cases and pretty much sure my code breaks in this class.

My code snippet is shown below:

public class CustomXmlTextReader : XmlTextReader
{
......
......
}

Doesn't really matter what is in this class. It gives an expection even when there is no code inside.

Any help is greatly appreciated.

Thanks,
Jai



Answer this question

Is XmlTextReader marked with HPA

  • Master Ruthless

    No, but it does make an inheritance demand for unrestricted CAS permissions. If you wish to inherit from it, the assembly in which your subclass resides will need to be deployed at the UNSAFE level.
  • Is XmlTextReader marked with HPA