我在这里问了一个类似但不相同的问题
我的 Windows CE 应用程序甚至无法在手持设备上启动(它的旧版本会启动,但新版本不会启动)。
它构建,复制,但只是拒绝运行;当我双击它时它“闪烁”,但就是这样。没有错误的消息,只是不会让步。
我添加了一个全局异常处理程序,希望它能够发现问题并通过以下代码让我一睹它的风采:
public static int Main(string [] args)
{
try
{
// A home-brewed exception handler (named ExceptionHandler()) is already
defined, but I'm adding a global
// one for UNHANDLED exceptions (ExceptionHandler() is explicitly called throughout the code in catch blocks).
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new UnhandledExceptionEventHandler(GlobalExceptionHandler);
. . .
// Instantiate a new instance of Form1.
frmCentral f1 = new frmCentral();
f1.Height = devIn.GetScreenHeight();
f1.Text = SSCS.GetFormTitle("The Return of Sancho Panza", "", "");
Application.Run(f1);
devIn.Close();
Application.Exit();
return 0;
}
catch(Exception ex)
{
SSCS.ExceptionHandler(ex, "Main");
return 0;
}
}
static void GlobalExceptionHandler(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception)args.ExceptionObject;
MessageBox.Show(string.Format("GlobalExceptionHandler caught {0}", e.Message));
}
……但还是不行;从小家伙那里听不到任何声音。
我能做些什么来找出正在发生的事情/为什么这只小野兽拒绝回应它的叫醒电话?
更新
问题是否与此有关,如果是,如何解决?
这个现有应用程序的更新版本和一个全新的简单应用程序都拒绝运行的情况表明,在编码、构建或部署过程中的某个地方存在根本缺陷。