title: WebApi application on Azure returning 500 errors for some endpoints
body: <p>I am setting up an ASP.NET WebApi application running on the Azure web application environment. Most of my controllers and endpoints work fine, but there are about 10 routes that return 500 errors "An error has occured".  It's not random. It's the same routes every time and I can find no pattern (not all the HTTP methods, from different controllers where other routes in that same controller work fine, and so forth)</p>
  
  <p>When these errors occur, no error logging gets triggered as far as I can tell in the app. (I am using Raygun.IO if that matters). I tried adding a global.asax file with following lines in the Application_Error function:</p>
  
  <pre><code>Exception ex = Server.GetLastError();
  new RaygunClient().SendInBackground(null, ex);
  </code></pre>
  
  <p>but as far as I can see, it doesn't get triggered when these 500 errors occur. The only thing I have found in the Azure server logs is the following warning in the Failed Requests log:</p>
  
  <p><a href="https://i.stack.imgur.com/roYNv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/roYNv.png" alt="enter image description here"></a></p>
  
  <p>However, I don't see any errors in the trace previous to that point. I'm also not finding any other errors in any of my Azure logs that I can relate to these failing routes.</p>
  
  <p>It's .NET 4.6 (tried 4.5.1 and 4.5.2 with no difference) WebApi using an OWIN startup class. Also tried updating all my packages to no effect.</p>