简体   繁体   English

WPF C#应用程序部署-运行exe时无反应

[英]WPF C# application deployment - Nothing happens when running the exe

I've copied over the content of the Debug folder on a Windows 7 VM and a Windows Vista laptop. 我已经复制了Windows 7 VM和Windows Vista笔记本电脑上Debug文件夹的内容。 Both had Dot Net 4.5 installed. 两者都安装了Dot Net 4.5。 All assemblies are set to copy local and AFAIK I don't reference anything not in the application folder. 所有程序集都设置为复制本地和AFAIK,我没有引用应用程序文件夹中没有的任何内容。 When I run the app on the two different developer computers (one Win8, one Win7) it runs fine as it does when running it in Visual Studio (F5). 当我在两台不同的开发人员计算机(一台Win8,一台Win7)上运行该应用程序时,它的运行效果与在Visual Studio(F5)中运行该应用程序时一样。

Not so on the deployment computers. 在部署计算机上不是这样。 The problem is that I get no error message. 问题是我没有收到任何错误消息。 Absolutely nothing happens after I double click the executable on the non-development machines. 在非开发机器上双击可执行文件后,绝对没有任何反应。

I tried starting it in WinDbg.exe and got this output: http://pastebin.com/43PbwyGx 我尝试在WinDbg.exe中启动它,并获得以下输出: http ://pastebin.com/43PbwyGx

So how to I go about debugging this to find out what's missing? 那么我该如何进行调试以找出缺少的内容?

looking at your WindDbg dump you have an 2nd Chance Execption of CLR exception - code e0434352 (!!! second chance !!!) . 查看您的WindDbg转储,您将看到CLR exception - code e0434352 (!!! second chance !!!)的第二次执行CLR exception - code e0434352 (!!! second chance !!!)
I would look at this article by Igor Dvorkin , Why do I keep getting exception code e0434352 . 我会看Igor Dvorkin的这篇文章, 为什么我会不断收到异常代码e0434352 Where he discusses it being a generic exception and how to fire up the cdb to find what the underlying exception was. 他在哪里讨论了它是一个通用异常,以及如何启动cdb以查找潜在的异常。

He also links to another of his blog posts, Finding CLR exceptions without visual studio where he describes using cdb. 他还链接到他的另一篇博客文章,即在不使用Visual Studio的情况下查找CLR异常 ,他在其中描述了如何使用cdb。

Are the dev machines 64-bit but the other machines 32-bit? 开发机是64位的,其他机器是32位的吗? If this is the case and you're building as AnyCPU, then all your references also need to be AnyCPU (or match the platform your program is running under). 如果是这种情况,并且您要构建为AnyCPU,则所有引用也都必须是AnyCPU(或与您的程序在其下运行的平台匹配)。 If you build as x64, then I think all your references need to be x64 as well, and the same goes for x86. 如果您将其构建为x64,那么我认为您的所有引用也都必须为x64,x86也是如此。

Usually the exception you'll see in this case is a BadImageFormatException (it's also typically logged to the Windows Application Event Log with a source of Side By Side Configuration). 通常,在这种情况下,您将看到的异常是BadImageFormatException(通常还将其与并排配置源一起记录到Windows应用程序事件日志中)。

Also, just an FYI, sometimes you might be able to find the exception in the Windows Event Log. 另外,仅供参考,有时您可能能够在Windows事件日志中找到异常。 I think it's the Application Log, and I think the Source is usually .NET Runtime, or Application Error. 我认为这是应用程序日志,并且我认为源通常是.NET运行时或应用程序错误。 The details may include both the actual exception as well as a stack trace. 详细信息可能包括实际异常以及堆栈跟踪。

I'm not sure what conditions need to be true for these errors to be logged, but it's something to consider. 我不确定要记录这些错误需要满足哪些条件,但这是需要考虑的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM