A solution to WebException trouble with .NET Compact Framework

I spent almost half a day to find a solution to a problem I had developing a little Windows Mobile application at work. This app downloads a CAB file via HTTP to install it on the device. I am using HttpWebRequest and Response classes from the .NET Compact Framework to do the download and it worked fine as long as I downloaded the file from server in our company’s network. As soon as I tried to download the file from a server on the internet which requires to use our company’s web proxy I got WebExceptions (ServerProtocolViolation: “The response did not contain an end of entity mark.”) whenever the getResponse is called on the HttpWebRequest.

Continue reading “A solution to WebException trouble with .NET Compact Framework”