ApplicationException was unhnadled by user code...

Last post 10-09-2006 4:24 PM by kgayda. 1 replies.

Sort Posts:

  • Crying [:'(] ApplicationException was unhnadled by user code...

    06-05-2006, 1:12 PM
    • Participant
      1,240 point Participant
    • StarPilot
    • Member since 11-15-2002, 9:44 AM
    • Denver Metro (CO)
    • Posts 248
    • ASPInsiders

    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)

    Keith Barrows


    Ad Astra Per Aspera - "To the stars thru difficulties"
  • Re: ApplicationException was unhnadled by user code...

    10-09-2006, 4:24 PM
    • Member
      10 point Member
    • kgayda
    • Member since 10-09-2006, 12:37 PM
    • Posts 2

    I am encountering the same problem with the labs in the Enterprise Library 2.0 with the Puzzler2 solution. 

     

Page 1 of 1 (2 items)