H
H?kan Bengtsson via .NET 247
I have written an automation class that connects to an URL, and downloads the content into an ordinary string variable.
But when I run my method I get an error saying:
Request for the permission of type System.Web.Permission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
My method looks like this:
WebClient webClient = new WebClient();
new WebPermission(NetworkAccess.Accept|NetworkAccess.Connect, "*").Assert();
StreamReader streamReader = new StreamReader(webClient.OpenRead(urlString));
String content = streamReader.ReadToEnd();
Does anyone know whats wrong??
But when I run my method I get an error saying:
Request for the permission of type System.Web.Permission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
My method looks like this:
WebClient webClient = new WebClient();
new WebPermission(NetworkAccess.Accept|NetworkAccess.Connect, "*").Assert();
StreamReader streamReader = new StreamReader(webClient.OpenRead(urlString));
String content = streamReader.ReadToEnd();
Does anyone know whats wrong??