Search code examples
silverlight-4.0wcf-ria-services

WCF RIA fails until "Clean Solution", then it works


Strange problem that just starting to happen on a SL/WCF RIA Services project that I have been working on for the past year. Recently I have been getting this message everytime I fix a bug and re-run the application.

Load operation failed for query 'GetDepartments'. An error occurred while executing the command definition. See the inner exception for details. InnerException message: Batch execution is terminated because of debugger request.

If I "Clean" solution, and then start the application, everything then works again.

I've tried to isloate the exact error, but it occurs during a call back of the Load operation, and I'm not sure what is going on.

I turned on SQL Profiler, and the query looks the same and I don't think I'm having an issue at the server.

Any hints would be appreciated. It takes too long to build already!

R


Solution

  • The fact that cleaning the solution helps could mean one of two things:

    1. You restarted the solution and that reset something (connection pool, thread, classloader cache, etc). Try restarting the solution without cleaning to see if that is the case
    2. Your build process somehow generates DLLs for the same code in multiple locations and when you do basic build only one of those gets updated. That may cause interface mismatch, serialization version mismatch or other similar problems. Try searching for DLL name in the whole solution and see how many places it shows up. Then do the basic build and see how many of them changed the timestamps. Similarly, try using FileMon to see from where the DLL is actually loaded.