Dotnetdreamer's Weblog

SharePoint, Silverlight and Azure

Posts Tagged ‘ASP.NET’

Security Exception in HttpWebRequest.EndGetResponse

Posted by Ramprasad Navaneethakrishnan on February 22, 2013

If you get a security exception during the call to HttpWebRequest.EndGetResponse, you might want to try the following to fix it.

1. Install and open Fiddler(http://www.fiddler2.com/fiddler2/version.asp)

2. Create ClientAccessPolicy.xml file as mentioned in the section “To use clientaccesspolicy.xml file to allow cross-domain access” in the link http://msdn.microsoft.com/en-us/library/cc197955(v=vs.95).aspx

3. See if the problem is fixed. If not, inspect the http request in fiddler. It will tell, whether it was able to find the clientaccesspolicy.xml file or not. In case of a 404 error, it will tell the place where it was looking for this xml file. In my case, it turned out to be in c:\inetpub\wwwroot.

 

Hope it helps.

Advertisements

Posted in Uncategorized | Tagged: , , , , , , | Leave a Comment »