简体   繁体   English

.net c#Winforms .exe不会在任何其他机器上启动

[英].net c# Winforms .exe wont start on any other machine

Ive developed a winforms application on my local machine using .net 4.0 and it runs fine. 我已经使用.net 4.0在我的本地机器上开发了一个winforms应用程序,它运行正常。 I have all dotnet versions installed. 我安装了所有的dotnet版本。

When I copied the .exe and all of its references (the complete bin\\debug and bin\\release) to another machine it simply does not run. 当我将.exe及其所有引用(完整的bin \\ debug和bin \\ release)复制到另一台机器时,它根本无法运行。 On one of my VMS it fires up visual studio express and asks if I want to connect a debgger. 在我的一个VMS上,它启动了visual studio express并询问我是否要连接debgger。 On other machines it just doesnt do anything. 在其他机器上它只是没有做任何事情。

But I can work out what on earth is going on. 但我可以弄清楚到底发生了什么。

I have referenced soem xceed dlls that are installed in GAC but not on the target machines GAC could this be the problem? 我引用了安装在GAC中但不在目标机器上的soem xceed dll GAC可能是这个问题吗?

How do I tell what the hell is going on? 我怎么知道到底发生了什么?

Pete 皮特

Yes, the xceed dlls (and every other referenced dlls) must exist on the target machine -- either included in the application directory or the GAC. 是的,xceed dll(以及所有其他引用的dll)必须存在于目标计算机上 - 包含在应用程序目录或GAC中。

You may try specifying "Copy Local = true" to the suspect references, and rebuilding your project, so that these dlls are specifically included with the compiled assemblies. 您可以尝试将“Copy Local = true”指定给可疑引用,并重建项目,以便这些dll特别包含在已编译的程序集中。

Have you checked that the other machine has a version of the .Net Framework installed? 您是否检查过其他计算机是否安装了.Net Framework版本? Failing that try to publish the application using the ClickOnce tool. 没有尝试使用ClickOnce工具发布应用程序。

ClickOnce will download and instal any missing dependencies for the .Net Framework if necessary. 如有必要,ClickOnce将下载并安装.Net Framework的任何缺少的依赖项。

if you deploy the pdb-files to the one VM with VS Express installed you should be able to connect the debugger and see the exception details. 如果将pdb文件部署到安装了VS Express的一个VM,则应该能够连接调试器并查看异常详细信息。 And yes, a missing assembly can (or better: will) cause that kind of behavior if the assembly is not only referenced but actually used in your application. 是的,如果程序集不仅被引用而且实际在您的应用程序中使用,那么缺少程序集可以(或更好:会)导致这种行为。 I would generally recommend to implement some kind of error logging (either to the event logs or to a text file). 我通常建议实现某种错误记录(对事件日志或文本文件)。

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

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