views:

52

answers:

2

I have a .NET C# winforms application which works great on my machine, but if I try to run it on another machine, it doesn't start up. No error message, no crash message, no window - nothing.

I've found that this always happens when a referenced assembly is missing. I guess this is .NET's general behavior and not specific to my app, is it?

Is there any way to configure .NET or my application such that it spits out a "referenced assembly missing" like error message in such cases?

A: 

Apart from the executable, are u also copying the DLL's from your debug/release folder to the destination machine?

Can you try by copying the entire debug/ release folder on other machine.

Also check application (if any) / event log for additional hint.

Ram
Hi Ram. This actually had been my exact reason why the application failed: I forgot to copy some assemblies. But my question here is why the application didn't complain about the missing assemblies.
chiccodoro
@chiccodoro : - I do not think if this is possible with .NET assemblies. for COM you can check if the DLL is already at the specified location. for .NET application it will just throw exception (I guess method not found) if the assembly is missing. A suggestion from me, make CopyLocal property = true for each reference so all such assemblies will be part of your debug/release folder.
Ram
+2  A: 

This isn't normal. The app will die from an unhandled exception which triggers a Windows Error Report. I would have to guess that the target machine has WER disabled or replaced.

Hans Passant
That was it! Too bad that the error report only tells me the application crashed, but not what assembly was missing. And too bad that the exe doesn't write anything to the standard error output "like good men do"... But at least I now know why it stayed completely silent.
chiccodoro
No such magic exists. You have to add it yourself, implement an event handler for the AppDomain.CurrentDomain.UnhandledException event.
Hans Passant