I'm experiencing a very weird issue running an ASP.NET Web Api application on my development machine.
The code in question throws an HttpResponseException within an ApiController. On a different machine, this code works as expected and will return a 400 Bad Request. On my development machine, this same code breaks and Visual Studio complains (HttpResponseException was unhandled by user code).
Throwing an HttpResponseException within an .net API controller is standard practice so I'd like to continue using this approach (vs. having the controller return an HttpResponseMessage and creating an error response). Has anyone run into this issue before?
Below is the code in question, I've removed all other code and it now just throws the exception.
public class SearchController : ApiController
{
public IEnumerable<Bill> Get()
{
throw new HttpResponseException( HttpStatusCode.BadRequest );
}
}
This same code behaves correctly on one machine, breaks on another (my development machine). Could there be some weird settings I've accidentally set in Visual Studio to break default behaviour?

throw new HttpResponseExceptionline and present the standard exception details dialog with the headingHttpResponseException was unhandled by user code. The response returned to the browser still has a status code of 400 though.