locked
override void HandleException in WCF Data Service ceases to work when overriding SaveChanges in EF RRS feed

  • Question

  • Background:

    EF 5.0
    WCF Data Services 5.4
    VS Studio Pro 2012

    To produce the issue:

    Within a WCF Data Service project, override the exception handler in the data service. Then override SaveChanges() in EF. Then, using a data service client, do a data update that produces an exception such as saving a record missing a required field.

    What happens:

    The overridden exception handler is not called when an exception occurs. A breakpoint set on the first line of the handler is not reached when an exception occurs.

    Should happen:

    The method:
        protected override void HandleException(HandleExceptionArgs args)
    
    should be called, but it isn't.

    file attachments

    No files are attached


    Al G.

    Thursday, January 23, 2014 2:52 AM

Answers

  • Hello RentAPlace,

    Thanks for your feedback, for this issue, I have reproduce it and I am trying to find out what is the problem and I will update once I find something.

    UPDATE:

    >>The overridden exception handler is not called when an exception occurs. A breakpoint set on the first line of the handler is not reached when an exception occurs.

    How do you deploy you server and client? Are the server and client under one same solution? If it is, I think we need to change the way to deploy them. Because the overridden exception handler is at server side, if we want to debug it to let the breakpoint be reached, we need to start up the server.

    One way to let work is to set the server as the StartUp project and start it, and start the client with the .exe like below:

    Another way is to change the deployed way to let server and client host on dependent solution each other and start up both them:

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, January 23, 2014 9:33 AM
    Moderator