I'm trying to design a Silverlight Application that accesses a SQL database through a WCF service. Operations that take place in the web app are fine, but as soon as I try to access data through the database I get this error:
An unhandled exception ('Unhandled Error in Silverlight Application)
Code: 4004
Category: ManagedRuntimeError
Message: System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.
It then gives me a list of debuggers to choose from, but upon choosing one it tells me its "Unable to attach to the crashing process. A debugger is already attached."
I'm fairly new to this and haven't been able to find much conclusive advise elsewhere. Any input or similar experience to share is appreciated (: Also I'm not sure what else would be helpful to solve this problem, so let me know if there's some other piece of info I should provide.
Thanks!
The message is saying that the code is failing and the exception generated hasn't been handled.
So I recommend that you put in a try
catch
around the location where you call the webservice for data and simply display a message box with the exception text. And/or put a breakpoint in the location of where the silverlight application calls the webservice. Run the debugger. See what value comes back and how its handled.
Hence I whole-heartedly recommend that you put in try catches in your code and to also handle any future failures and report them appropriately; for this won't be the only exception your code will generate.