Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight web app Unhandled exception code 4004

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!

like image 314
Kyle Breton Avatar asked Nov 25 '25 04:11

Kyle Breton


1 Answers

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.

like image 62
ΩmegaMan Avatar answered Nov 27 '25 19:11

ΩmegaMan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!