I am trying to implement Elmah error logging in an ASP.NET WEB API 2 project that doesnt use MVC.
I tried both Elmah and Elmah.mvc nuget packages and i am not even able to browse to the emlah page using both.
Is elmah supported in ASP.NET WEB API 2?
PS. I havent even started logging errors.I am just trying to browse to the page (elmah.axd in elmah or /elmah in elmah.mvc) and it is not accessible.
Edit: i am trying to implement the method mentioned in the blog.
According to it, the elmah.axd page should be accesible right after the package is added. But it is not working for me.
update: Error Logging in working fine BTW. The only issue is I cant view error logs in the browser.
Elmah is not currently supported in Web API because Web API does not use HttpContext. If you host a Web API under IIS then it is possible to access the HttpContext that comes from the hosting ASP.NET runtime.
Which host are you using? If it isn't IIS/ASP.NET runtime then you will not be able to use Elmah.