Custom Exception Handler with Ent Library 5.0 Silverlight

Topics: Building and extending application blocks, Exception Handling Application Block, Silverlight Integration Pack
Sep 7, 2011 at 10:59 PM

Hi,

I am trying to use custom exception handler for my Silverlight app. However whenver I change manually xaml file and try to rebuild, the VS 2010 IDE crashes and shuts down. When I looked into Eventvwr I found this below mentioned error with source as ASP.Net 4.0.30319.0 and eventid 1325

An unhandled exception occurred and the process was terminated. Application ID: DefaultDomain Process ID: 9580 Exception: System.ArgumentException Message: Value does not fall within the expected range. StackTrace: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.VisualStudio.Platform.WindowManagement.Rdt.GetDocumentInfo(UInt32 cookie) at Microsoft.VisualStudio.Platform.WindowManagement.Rdt.GetHierarchyItem(UInt32 cookie) at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.UnadviseHierarchyEvents() at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.DocumentReleased(Object sender, EventArgs e) at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.FireDocumentReleased() at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.DocumentUnlocked(Object sender, EventArgs e) at Microsoft.VisualStudio.Platform.WindowManagement.RdtLock.FireDocumentUnlocked() at Microsoft.VisualStudio.Platform.WindowManagement.RdtLock.UnlockDocument(RdtFlags flags) at Microsoft.VisualStudio.Platform.WindowManagement.RdtLock.DisposeNativeResources() at Microsoft.VisualStudio.PlatformUI.DisposableObject.Finalize()

Please advice.

Thanks

Sep 8, 2011 at 6:18 AM

Hi,

Kindly check again the modifications you did to your configuration. Looking at the exception, it doesn't really relate to the Enterprise Library at all. You might deleted some xaml nodes or something.  

 

Noel Angelo Bolasoc
Avanade Software
Avanade, Inc.
entlib.support@avanade.com

Sep 8, 2011 at 9:55 PM
To my strange, when I comment below section in web.config, it works fine.
<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <bindings>
      <customBinding>
        <binding name="Microsoft.Practices.EnterpriseLibrary.Logging.Service.customBinding0">
          <binaryMessageEncoding />
          <httpTransport />
        </binding>
      </customBinding>
    </bindings>
    <services>
      <service name="Microsoft.Practices.EnterpriseLibrary.Logging.Service.LoggingService">
        <endpoint address="" binding="customBinding" 
                  bindingConfiguration="Microsoft.Practices.EnterpriseLibrary.Logging.Service.customBinding0"
         contract="Microsoft.Practices.EnterpriseLibrary.Logging.Service.ILoggingService" />
      </service>
    </services>
  </system.serviceModel>
Any thoughts.
Sep 11, 2011 at 11:33 AM

It looks really strange. Can you send us a sample repro project for us to investigate? 

 

Noel Angelo Bolasoc
Avanade Software
Avanade, Inc.
entlib.support@avanade.com

 

Sep 13, 2011 at 2:44 AM

I solved the issue. Thanks.

Now I want to log all my exceptions to DB. Can you help me getting started. If you have any instruction steps, document or sample app-that would be great.

Thanks

 

Sep 13, 2011 at 3:39 AM

Hi,

Please look at the CHM file that comes with Ent Lib. It has a Common Scenarios section for logging. (That can be found here: http://entlib.codeplex.com/releases/view/43135)

If you want, you can also use the Ent Lib configuration tool's wizard and follow the instructions there(In the menu bar, go to Wizards --> Log Exception to Database ).