Code Access Security - System.Security.SecurityException: Request failed.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Crowe [MVP 2005/2006]

    Code Access Security - System.Security.SecurityException: Request failed.

    I have written a Web User Control that runs inside of Sharepoint, but when I
    want to use a custom convertor class to convert an XML attribute I get the
    following error:



    System.Security .SecurityExcept ion: Request failed.





    Basically I start with a DataSet that I then want to transform into HTML via
    an XSL stylesheet.



    I do not appear to be able to use the XsltArgumentLis t Extension Object.
    [color=blue]
    >From what I have found this object requires FULL TRUST.[/color]



    If I comment out the args.AddExtensi onObject("urn:t rimble-date",

    Convertor); the code works fine.



    This code basically installs an extension object which in my case converts
    date/times to a format that I want to use in my XSL



    To make this worse this needs to run as part of a sharepoint application.



    I have tried adjusting the security on the DLL that this code is part of and
    it does not help.



    Does anyone have any thoughts?



    try

    {

    XmlDataDocument datadoc = new XmlDataDocument (ds);

    XslTransform myXslTrans = new XslTransform() ;

    myXslTrans.Load (XSLFileSpec);



    // Add an object to convert DateTime format.

    HelpdeskDateCon vertor Convertor = new HelpdeskDateCon vertor();

    XsltArgumentLis t args = new XsltArgumentLis t();

    args.AddExtensi onObject("urn:t rimble-date", Convertor);



    myXslTrans.Tran sform(datadoc,n ull, stWrite,null);

    }

    catch(Exception ex)

    {

    stWrite.Write(e x.ToString());

    }



    Chris



Working...