I have several ASP.NET websites in a solution along with a common C# code project. Something as follows:
- Website1
- Website2
- ...
- Website(n)
- Common
First off I want to use a Global.asax file to log all unhandled exceptions. I could have one Global.aspx file per website but all the code will be the same and it seems pointless having to keep multiple copies of the same file upto date. Is there a way to have the Global.aspx file in the Common library and then link to it from each website. I have tried doing Add Exiting Item > Add as Link but it doesn't get run by the page.
Secondly all the websites need an Error page which I can write information to (not just a simple html page) so I have an Error.aspx page which I want to redirect to along with the error details. Again I could have one per website, but its going to be the same page. Is there a way I can store this in the Common project and link to it? The only solution so far for this I can think of is to have an Error website which has the Error page in it.