title: ASP.NET WebPermission Security Exception
body: <p>I usually hate posting these types of questions as normally I find that the best way to really learn is to figure out the answer yourself. </p>
  
  <p>However, I need an answer to this question really quickly as I have a client who can't run her business due to this problem.</p>
  
  <p>Yesterday my ASP.NET host provider moved my application from a server running .NET 1.1 to one running .NET 1.1 and 2.0. My problem is that when I test the move the main site page (Default.aspx) will not load </p>
  
  <p><strong>"Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.</strong> </p>
  
  <p><strong>Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."</strong></p>
  
  <p><strong>[SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
     System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp; stackMark, Boolean isPermSet) +0
     System.Security.CodeAccessPermission.Demand() +59
     System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) +147
     System.Net.HttpRequestCreator.Create(Uri Uri) +26
     System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) +298
     System.Net.WebRequest.Create(Uri requestUri) +28
     System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri) +30
     System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri) +12
     System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri) +4
     System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +52
     PilatesPlusDublin.PilatesPlusDublinws.PilatesPlus.InsertException(String sModuleName, String sException, Int32 iUserID) +97
     PilatesPlusDublin.MainDefault.Page_Load(Object sender, EventArgs e) +144
     System.Web.UI.Control.OnLoad(EventArgs e) +99
     System.Web.UI.Control.LoadRecursive() +47
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
     System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
     System.Web.UI.Page.ProcessRequest() +86
     System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
     System.Web.UI.Page.ProcessRequest(HttpContext context) +49
     ASP.maindefault_aspx.ProcessRequest(HttpContext context) +4
     System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64"</strong></p>
  
  <p>If WebPermission isn't available at the hosting site, how do I configure my site to allow access to the page?  Is there some tags that need to be put into the web.config?  Note - we have no access to machine.config or any other IIS settings. </p>
  
  <p>I understand that people hate reading and answering these types of question but any help on what I, or my hosting site need to do to fix this would be appreciated enormously </p>