如何调试未在新PC上执行的EXE(在开发框上工作) [英] How to debug an EXE not executing on new PC (Working on dev box)

查看:54
本文介绍了如何调试未在新PC上执行的EXE(在开发框上工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我开发了一个在Windows 7(32位)上运行的名为RBS07.exe的C#应用​​程序,它可以访问远程SQL数据库。现在它已准备好进行测试,因此我需要在Windows 7(64位)计算机上安装.exe。在开发盒上编译后,我将RBS07.exe复制到测试PC并设置适当的ODBC连接。但是,当我在测试PC上运行此RBS07.exe时,它会显示第一个窗口并随后崩溃(我怀疑在尝试连接到远程SQL服务器时。错误消息是应用程序中发生了未处理的错误 - 对象引用没有设置为对象的实例



测试PC没有安装MS Visual 2010。有什么方法可以获得有关导致错误?



问候

Pat

解决方案

远程调试是一项功能Visual Studio。



在远程计算机上安装。



http://www.microsoft .com / zh-CN / download / details.aspx?id = 475



搜索MSDN以获取有关使用远程调试的说明。


< blockquote>是的,记录。



log4net Tutorial [ ^ ]



这真的会给你可以处理应用程序告诉你的内容。



但有一件事,当复制这个应用程序时,你只是复制exe吗?你不需要app.config文件,或者它是否嵌入在exe中?



你是否尝试过ClickOnce进行部署?


由于您是在32位环境中开发,因此将其编译为32位代码并查看它是否适用于win-64。



如果失败,可能是你没有分发你程序中使用的所有dll。



我通常使用老式日志来解决您现在面临的问题。只需从您怀疑代码被破坏的区域写入日志即可。你最终会把它钉死。记录总是有用的。你永远不知道应用程序将在何时何地破解。分析日志有很大帮助。

祝你好运。


Hello,
I have developed a C# application running on Windows 7 (32 bit) called RBS07.exe which accesses a remote SQL database. It is now ready for testing and so I need to install the .exe on a Windows 7 (64 bit) machine. After compiling on the development box I copied the RBS07.exe to the test PC and set up the appropriate ODBC connections. However when I run this RBS07.exe on the test PC , it displays the 1st window and subsequently crashes (I suspect when attempting to connect to the remote SQL server. The error message is "Unhandled error has occurred in your application - Object reference not set to an instance of an Object"

The Test PC does not have MS Visual 2010 installed. Is there any way that I can get more information on what is causing the error ?

regards
Pat

解决方案

Remote debugging is a feature of Visual Studio.

Install this on your remote machine.

http://www.microsoft.com/en-us/download/details.aspx?id=475

Search MSDN for instructions on using remote debugging.


Yes, Logging.

log4net Tutorial[^]

This will really give you a handle on what the application is telling you.

One thing though, when this application is copied, are you just copying the exe? do you not need the app.config file with it or is this embedded within the exe?

Have you tried ClickOnce for the deployment?


Since you are developing in 32-bit environment, compile it to 32-bit code and see if it works on win-64.

If this fails, possibly, you are not distributing all dlls used in your program.

I usually use "old fashioned" logging to solve problems like you are facing now. Just write to log from areas where you suspect code is broken. You will eventually nail it down. Logging is always helpful. You never know where and when your application will break. Analyzing logs helps a lot.
Good luck.


这篇关于如何调试未在新PC上执行的EXE(在开发框上工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆