I am using .net Framework 4.5. The following piece of code works fine when i run through Visual Studio on my machine. It also works fine when deployed onto my local IIS 7.5(Windows 7). However on deploying the same to one of the dev boxes having the similar
.net 4.5 framework (Windows 2008 Server R2) an exception is thrown. Below are the details of the exception and the line where it is thrown. To be brief i have used both webclient and httpwebrequest classes to post the request however the exception seems to
be consistent. Any post operation to any website fails on deployed code
Code snippet
WebClient wc = new WebClient();
string postbody = "test";
string response="";
try
{
response = Encoding.ASCII.GetString(wc.UploadData("http://internalservice/abc", Encoding.ASCII.GetBytes(postbody)));
//EXCEPTION THROWN ON wc.UploadData
}
EXception Details:-
Loading ...
Go to the complete details ...