调试C#自定义安装程序类 [英] Debugging C# Custom Installer Classes

查看:114
本文介绍了调试C#自定义安装程序类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了扩展安装程序,并覆盖afterInstall安装类,但我得到一个空指针异常。我该如何去调试我的课?

I have written an installation class that extends Installer and overrides afterInstall, but I'm getting a null pointer exception. How can I go about debugging my class?

推荐答案

东西是方便的难的code调试节是

Something that is handy for hard to debug sections of code is

System.Diagnostics.Debugger.Break()

将抛出捕获任何安装调试器断点(VStudio,WinDbg中,远程调试等等)。

Will throw a breakpoint caught by any installed debugger (VStudio, WinDbg, Remote debugger etc...).

使用它真正棘手的地方经常F5 +去还是附加到进程调试是很难或不可能执行,一些例子包括:

Use it to debug really tricky areas where regular F5+Go or "Attach to Process" is difficult or impossible to perform, some examples include:

  • 在短暂的过程
  • 在时间敏感的过程
  • 在闯入催生子流程
  • 在安装
  • 在服务停止/启动
  • 在分布式系统

这篇关于调试C#自定义安装程序类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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