I am creating a C# dll for use on our intranet, so there are some security issues. I have given the web unrestricted File IO permissions. This function works fine:
but some of our XML is dynamically created from ASP pages, and it times out on some of them that take longer. I couldn't find a way to set the TimeOut through the XML load, so I decided to use a WebRequest. This function gets:
I just tried giving the web FullTrust, and it worked. This obviously isn't what we want to do, so any suggestions?
"Programming is like sex, one mistake and you have to support it forever."
John
johnmc@mvmills.com
Code:
[FileIOPermission(SecurityAction.Assert, Unrestricted = true)]
protected void LoadIt (string path)
{
XmlDocument doc = new XmlDocument();
doc.Load(path);
}
but some of our XML is dynamically created from ASP pages, and it times out on some of them that take longer. I couldn't find a way to set the TimeOut through the XML load, so I decided to use a WebRequest. This function gets:
Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
Code:
[FileIOPermission(SecurityAction.Assert, Unrestricted = true)]
protected void LoadIt (string path)
{
XmlDocument doc = new XmlDocument();
WebRequest request = WebRequest.Create(path);
request.Timeout = 3600000;
doc.Load(request.GetResponse().GetResponseStream());
}
I just tried giving the web FullTrust, and it worked. This obviously isn't what we want to do, so any suggestions?
"Programming is like sex, one mistake and you have to support it forever."
John
johnmc@mvmills.com