Hi
The MvcApplication.Error event in my MVC application will not fire.
I have the following in web.config:
<system.web>
<customErrors mode="Off" />
...
And the following event defined in global.asax:
Public Sub MvcApplication_Error(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Error
Dim lastErrorWrapper As HttpException = CType(Server.GetLastError(), HttpException)
Using sw As New IO.StreamWriter("c:\test.txt")
sw.WriteLine(lastErrorWrapper.StackTrace)
End Using
End Sub
Obviously the above is massively simplified for the purposes of this question! In the end I will have it email the developers when an error occurs.
The problem is that this event will not fire, either in VS or when published to IIS.
Can anyone help?
Thanks in advance Jon