Possible security error loading an Xsl?

From: Ed Murphy (Murphy_at_discussions.microsoft.com)
Date: 05/13/05

  • Next message: SpIcH: "How to protect data in executable file?"
    Date: Fri, 13 May 2005 08:36:06 -0700
    
    

    Hi,

    I've run into a problem that may be security related that I haven't been
    able to find a whole lot of information on and I'm hoping someone might
    recognize it enough to give me some pointers.

    I've got the following code:

      XslTransform myTransform = new XslTransform();
      myTransform.Load(@"M:\MyData\MyTransform.xsl");

    When the call to the Load routine executes, I get a system
    ArgumentException with the description "Invalid Site".

    Here's the stack trace:
      at System.Security.Util.SiteString.CreateSeparatedSite(String site)
      at System.Security.Util.SiteString..ctor(String site)
      at System.Security.Policy.Site.ParseSiteFromUrl(String name)
      at System.Security.Policy.Site.CreateFromUrl(String url)
      at System.Xml.XmlSecureResolver.CreateEvidenceForUrl(String
    securityUrl)
      at System.Xml.Xsl.XslTransform.Load(String url, XmlResolver resolver)
      at System.Xml.Xsl.XslTransform.Load(String url)
      ...

    I haven't been able to find much information on CreateSeparatedSite and
    what I've been able to find on ParseSiteFromUrl doesn't really tell me
    much. The XSL file is there and teh XSL code is correct (it's been used
    in other instances with no problems.) This is the first time this code
    has been tested on this particular laptop running Windows 2003 server,
    but it's been run on that platform (and other) Windows boxes elsewhere
    and not received this error.

    Could this be a system setting under security? In order to test this
    code, I did have to create a FullTrust Runtime Security policy for the
    URL file://M:/* under the .NET configuration for Runtime Security
    Policy > Machine > Code Groups > All_Code. Might there be some other
    entry I have to make?

    Got a headache from banging my head against this one, so any help is
    MUCH appreciated.

    Regards,
    Ed


  • Next message: SpIcH: "How to protect data in executable file?"