New Posts New Posts RSS Feed: Silverlight Faults
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Silverlight Faults

 Post Reply Post Reply
Author
skingaby View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post Topic: Silverlight Faults
    Posted: 01-Sep-2009 at 8:33am
MSDN Magazine has an article this month about handling Silverlight Faults. It references the MSDN site: http://msdn.microsoft.com/en-us/library/dd470096(VS.95).aspx.
This code provides a simple Fault Behavior. However, when I try to implement it, I get the dreaded Not Found error.
Can we implement this?
Here's the Shell.Web's Web.config that doesn't work:
<system.serviceModel>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" />
    <extensions>
      <behaviorExtensions>
        <add name="silverlightFaults"
             type="Png.Silverlight.Behaviors.SilverlightFaultBehavior, Png.Silverlight.Behaviors.FaultBehavior"/>
      </behaviorExtensions>
    </extensions>
    <diagnostics>
      <messageLogging logEntireMessage="true"></messageLogging>
    </diagnostics>
    <behaviors>
      <endpointBehaviors>
        <behavior name="SilverlightFaultBehavior">
          <silverlightFaults/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <services>
      <service name="EntityService">
        <endpoint address="" binding="customBinding" bindingConfiguration="customBinaryBinding" contract="IdeaBlade.EntityModel.IEntityServiceContract" behaviorConfiguration="SilverlightFaultBehavior"/>
      </service>
      <service name="IdeaBlade.EntityModel.Server.EntityServer">
        <endpoint address="" binding="customBinding" bindingConfiguration="customBinaryBinding" contract="IdeaBlade.EntityModel.IEntityServerContract" behaviorConfiguration="SilverlightFaultBehavior"/>
      </service>
    </services>


Back to Top
skingaby View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post Posted: 01-Sep-2009 at 8:34am
P.S. Where can we add the
<serviceDebug includeExceptionDetailInFaults="true"/>
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 01-Sep-2009 at 10:09am
DevForce Silverlight already uses a fault behavior and sets the includeExceptionDetailInFaults flag to true.  That's why you get any exception information at all on the client, even if the information sometimes seems a bit paltry.  We actually used the MSDN library article you linked for guidance when we wrote our behavior.  Unless your implementation does something above and beyond that described in the article, then you won't gain anything.  If you do want to use your implementation, you'll need to remove the DevForce IdeaBlade.Core.Wcf.Extensions.SilverlightFaultBehavior before adding yours.
 
So maybe the question is, how do we improve the exception information received on the client?  The EntityServerException, which almost any server-side exception is wrapped in, may not be capturing all the inner exception information.  We also have the problem that an exception received on the client can be re-thrown (sometimes more than once), so the stack trace becomes fairly unusable.  Another complication is that frequently many errors manifest as "Server not found".  This is frustrating, but from the client's perspective it's true - it can't communicate with the server and usually the underlying CommunicationException doesn't explain why.  Any errors that occur while a response is sent to the client - usually serialization errors - also don't provide useful exception information.
 
Do you have any specific areas where you'd like to see better exception detail?
 
 
Back to Top
skingaby View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post Posted: 01-Sep-2009 at 10:43am
Ah hah. Well. That shuts that down then, doesn't it. I was hoping this trick would magically provide me with better exception tracing. It is proving to be VERY troublesome to debug the Silverlight / Client / Server / Ideablade / EF / Oracle stack. I was hoping to get a clue, but it sounds like you're a step ahead and the errors we have been seeing may be the best we can get.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 01-Sep-2009 at 10:56am
We really are looking to provide better exception information, it's just not that easy.
 
During debugging / troubleshooting I find two things really helpful -
  • The debug log generated on the server.  If the exception occurred during server processing the full exception information will normally be logged.  If you encounter EF or database errors, the log will likely have the details needed.
  • Opening EntityService.svc from the browser.  We don't provide service metadata, but if the page opens without errors then you at least know that the service can start.  If an error is shown it will usually be very helpful.  So many different things can cause the service to not even start, and the messages received by the client won't usually help diagnose the problem.
Back to Top
skingaby View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post Posted: 03-Sep-2009 at 8:01am
I had forgotten about the debug log on the server. It has been very helpful today in debugging the server-side failures. Thanks!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down