WCF service cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher RRS feed

  • Question

  • I created wcf service and its unit test. At beginning, everything worked fine. My service ran fine and I could debug my unit test step by step. Everything is on the same local box.

    After several weeks left the project alone, there is requirement to modify the service. I modified one of the interface methods. I deleted the original service reference from my unit test and added the same service back. However, when I was debugging the unit test code, I always got "The message with Action xxx cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher."

    I double checked the service url, contract, etc. Everything matched. Then I found out if I ran the unit test instead of debugging it, the same unit test passed without any error. I don't know why. I did further test. I created a brand new console app and added the same service reference via VS and copied the unit test code. I can debug through my unit test code, my wcf service code, and another wcf service code (called by previous service) without any problem!!!

    I just don't know why? I also encountered "Address filter mismatch" problem with same kind of situation - at beginning everything worked fine; Modified interface; Address mismatch problem occurred, but only for debug mode with my unit test.

    Is there any cache some where? I deleted the whole service reference folder; I cleaned my solution; but neither "Address filter mismatch" or "Contract filter mismatch" went away. I have to create a brand new project to debug my service. I think there is bug somewhere in VS 2013 related to adding service reference.

    I wonder if anybody else has the same experience, or can explain why?

    Thanks in advance!!!

    Wednesday, August 14, 2013 4:55 AM


  • Hi s liu,

    The error message you provided just indicate that the ServiceContract used by client-side doesn't match the target service. However, as you mentioned that the service reference has been updated and the error only occurs only when debugging in VS, it is not likely due to the client proxy code not updated. If the service is using HTTP binding, you can try using fiddler to capture the request message of the service operation call when using and not using VS debugging. Then, you can compare the two messages to see if the request message sent at debugging time is different from the one sent without debugging.

    Also, are you using Visual Studio 2013 preview version? If you can reproduce this issue through very simple servie and client project, I suggest you also submit this issue to through the VS 2013 feedback tool:

    #Microsoft Visual Studio 2013 Feedback Tool

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 15, 2013 2:05 AM