Solution: The remote server returned an error: (417) Expectation Failed

This could be one of the issue you might face while using service call or HTTP Post to server. Though this issue rarely happens but in case you encounter such error in your production, possibility is your client application is facing issue connecting to the server due to proxy server.


If you come across such issue, this quick blog post will help you to resolve it. You don’t need to do much, but just a configuration settings will help you.


Solution to "The remote server returned an error: (417) Expectation Failed" (


You might face this issue when a client is running through a HTTP 1.0 proxy server. The client (the .asmx or WCF service proxy without any configuration) is sending a HTTP 1.1 request and the proxy rejects it before any server could ever get involved. Some server sends the 417 error as part of the header in response.


In .NET, the System.Net.HttpWebRequest adds the header 'HTTP header "Expect: 100-Continue"' to every request unless you explicitly ask it not to by setting this static property “System.Net.ServicePointManager.Expect100Continue” to false.


If you encounter the error “The remote server returned an error: (417) Expectation Failed”, add the following code in you application before the call:


System.Net.ServicePointManager.Expect100Continue = false;



You can also specify that property in your app.config:


            <servicePointManager expect100Continue="false" />



You can learn more about this settings/properties in MSDN: ServicePointManager.Expect100Continue


Hope that the post was useful and helped you to resolve your issue connecting to service. Don’t just stop here. Check out my other blog posts, articles and tips. I am available on Twitter, Facebook and Google+. Do connect with me there to get the latest technical updates that I share. Also, subscribe to my blog’s RSS feed and email newsletter. Happy coding.


If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter , Facebook , Google+ and LinkedIn . I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.


  1. This comment has been removed by a blog administrator.

  2. Hi Kunal,

    I have an issue, please help me.

    I want to silent printing but not with default printer.

    I want to select printer there is no property with Process class to select printer.


© 2008-2016 - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top