Cashif Ilyas February 2016

Simple WebClient not working: Customized cultures cannot be passed by LCID, only by name

I am trying to send a simple POST request to a URL using WebClient but I am getting

An exception occurred during a WebClient request.

And in InnerException

Customized cultures cannot be passed by LCID, only by name.

Apparently there is no discussion about this exception on the internet.

Here is my code:

public static void Send(string message)
    var url = "";
    using (var client = new WebClient())
        client.Credentials = new NetworkCredential("api", "some_password");
        var values = new NameValueCollection();
        values["from"] = "Mailgun Sandbox <>";
        var response = client.UploadValues(url, values);
        var responseString = Encoding.Default.GetString(response);

Exception is raised at client.UploadValues(url, values)


Cashif Ilyas February 2016

Apparently, it is a known issue with older versions of .NET (if your System Locale is not US)

Moving to the .NET 4.0 or higher solves the issue.

Post Status

Asked in February 2016
Viewed 1,033 times
Voted 6
Answered 1 times


Leave an answer