Share via


SerializationException with IIS [Utkarsh Shah]

If you are getting an error stating that...
System.Runtime.Serialization.SerializationException was unhandled Message="The input stream is not a valid binary format. The starting contents (in bytes) are: 53-65-72-76-65-72-20-65-6E-63-6F-75-6E-74-65-72-65 ..."

This typically happens when IIS sends back an error message as plain text which the binary formatter doesn't know how to handle. Try changing the formatter to SoapFormatter; that way you will be able to read the actual error message. You can solve quite a few IIS configuration or service issues by making this change.