I am trying to get a simple example (Tom Hollander's External configuration files in Enterprise Library for .NET Framework 2.0) working and am running into an error within the Exception Handling Block that is driving me nuts.
Basically, I am doing a very simple "divide by zero" error to test this with. Somewhere in the Exception Handling I am getting an "ApplicationException was unhnadled by user code" error.
It is in ExceptionPolicyEntry.cs
In the private Exception IntentionalRethrow(Exception chainException, Exception originalException) method
Exception wrappedException = new ExceptionHandlingException(Resources.ExceptionNullException); gives an internal error of "Unable to rethrow exception: The exception to throw is null."
Of course it's null. We rae passing in an ExceptionNullException. I am so confused.
Here is the full error:
System.ApplicationException was unhandled by user code
Message="Crikey!"
Source="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
StackTrace:
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry.IntentionalRethrow(Exception chainException, Exception originalException)
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry.RethrowRecommended(Exception chainException, Exception originalException)
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry.Handle(Exception exceptionToHandle)
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl.HandleException(Exception exceptionToHandle)
at _Default.Page_Load(Object sender, EventArgs e) in c:\VS2005_Projects\EntLibExamples\Default.aspx.cs:line 50
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)