I have a controller action that returns a 400 if validation fails:
return new HttpStatusCodeResult(HttpStatusCode.BadRequest, "My custom message");
When running locally I get the standard "400 Bad Request", instead of the expected "400 My custom message". It works fine on the deployed site, and when running locally on my old PC.
Could this be an IIS or Visual Studio configuration problem? I've tried diffing the applicationHost.config of my old and current computers but there was nothing obvious there.
Images of the responses (can't embed yet):
- The response from localhost on the new machine
- The response from the deployed site on the new machine
- The response from localhost on the old machine
Edit: Old computer's OS was Windows 7, new computer's OS is Windows 10. Both have IIS Express 10 installed, which the project is configured to use.