当程序集丢失时,.NET应用程序静默失败。

时间:2023-01-19 10:27:18

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.

我有一个。net c# winforms应用程序,它在我的机器上运行良好,但是如果我试图在另一台机器上运行它,它就不会启动。没有错误消息,没有崩溃消息,没有窗口-什么都没有。

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?

我发现当引用的程序集丢失时总是会发生这种情况。我猜这是。net的一般行为,不是我的应用程序特有的,对吧?

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?

有什么方法可以配置。net或我的应用程序,让它在这种情况下输出“引用程序集缺失”,比如错误消息?

2 个解决方案

#1


6  

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.

这不是正常的。该应用程序将死于一个未处理的异常,该异常触发一个Windows错误报告。我不得不猜测目标机器已经禁用或替换。

#2


0  

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

除了可执行文件之外,u是否也将DLL从调试/发布文件夹复制到目标计算机?

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

您可以尝试复制其他机器上的整个调试/发布文件夹吗?

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

还要检查应用程序(如果有的话)/事件日志以获得更多的提示。

#1


6  

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.

这不是正常的。该应用程序将死于一个未处理的异常,该异常触发一个Windows错误报告。我不得不猜测目标机器已经禁用或替换。

#2


0  

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

除了可执行文件之外,u是否也将DLL从调试/发布文件夹复制到目标计算机?

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

您可以尝试复制其他机器上的整个调试/发布文件夹吗?

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

还要检查应用程序(如果有的话)/事件日志以获得更多的提示。