FileIOPermission

G

Guest

I have an application that does a XML transform. When I placed the
application on a file share and then clicked to run it, the application
starts but stalls with this error. ( I do have full permissions on the
server - it needs to read the xml dom, xsl and write out the output to the
share ). The writing to the share is not an issue with legacy VB6 apps I have
placed on the share. Any ideas ? Here's the full message:Request for the
permission of type System.Security.Permission.FileIOPermissions, mscorlib =
1.0.5000.0, culture=neutral, PublickeyToken = b77a5c561934e089 failed. ...
Thanks
 
G

Guest

Not an answr, but when I moved the XML files and XSL to the share heres what
happens:

private string TransformAndPersistXML( string xmlDocPath, string
XSLDocPath, string outputFileName)
{ string errorMes ="";
try
{ System.Xml.Xsl.XslTransform xslt = new System.Xml.Xsl.XslTransform();
System.Xml.XPath.XPathDocument doc2 = new
System.Xml.XPath.XPathDocument(xmlDocPath);
xslt.Load(XSLDocPath); // ERROR HERE:{"Invalid URI: The hostname could not
be parsed." }
System.IO.TextWriter tw = new StreamWriter(outputFileName,false);
System.Xml.XmlTextWriter writer1 = new System.Xml.XmlTextWriter(tw);
xslt.Transform(doc2, null, writer1,null); // a simple XML file with no
//external //references // does not require a resolver -thelast parameter,
tw.Flush();
tw.Close();
}
catch (Exception e )
{ errorMes+=e.Message + "\nl";
errorMes+="Function TransformAndPersistXML ";
errorMes+="Input params : " + xmlDocPath + ", " + XSLDocPath + ", " +
XSLDocPath;
}
return errorMes;
}
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


You need to give your application enough privilegies to access your local
files :

- Administrative Tools
- Go to Microsoft .Net Framework 1.1 Configuration
- Select Runtime Security Policy option
- In the right panel Adjust Zone Security
- In the Security Adjustmetn Wizard select the Local Intranet group
- Set the Trust Level up to Full Trust


cheers,
 
G

Guest

Thanks - when I returned to work ( not over VPN ), the code ran fine. I
recompiled with the information you gave me. I will need to retry it later
tonight - thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top