I have a one page ASP.NET 4.0 C# script running. In debug mode my script works just fine but when I publish it, it seems like it is not sending the credentials when making the WebRequest. The following is the code I am using, I have tried a bunch of things but I keep getting a 401 Unauthorized when I am using my published version of the script. BTW I am using IIS 7
WebRequest fwRequest = HttpWebRequest.Create(fwURL);
fwRequest.UseDefaultCredentials = true;
//fwRequest.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse myHttpWebResponse = (HttpWebResponse)fwRequest.GetResponse();