使用 Framework 4.0 的自定义安装程序操作中未命中断点
我花了几个小时尝试调试使用 .net Framework 4.0 构建的自定义安装程序 dll,但无论我尝试什么,都不会遇到断点。我在 3.5 中有一个类似的项目,使用 Debugger.Break() 命中断点没有问题。在几乎放弃这个之后,我决定切换回3.5。我立刻就可以再次达到断点!因此,出于某种原因,使用 4.0 并尝试启动调试器不起作用。
I spent hours trying to debug a custom installer dll built using .net framework 4.0, but no matter what I tried the break point would not be hit. I had a similar project in 3.5 and there were not problems hitting the breakpoints using Debugger.Break(). After almost giving up on this, I decided to switch back to 3.5. Immediately I could hit the breakpoints again! So for some reason using 4.0 and trying to hit the debugger does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不知道为什么这被否决了?用 .NET 语言编写自定义操作通常是一个非常糟糕的主意,因为目标计算机可能缺少运行代码所需的依赖项。
话虽如此,我认为如果没有为 .NET 4.0 安装调试符号,可能会导致断点问题。我从未遇到过这种情况,我也不确定是否有其他原因,但您可以尝试安装 .NET 4.0 SDK 而不是仅安装 .NET 4.0 运行时。
我不确定您应该安装什么设置,但我会查看 http: //msdn.microsoft.com/en-us/netframework/default.aspx 。
Don't know why this has been downvoted? It's generally a very bad idea to write custom actions in .NET languages since the dependency needed to run the code might be missing from the target machine.
Having said that, I suppose the breakpoint problem could result if you have no debugging symbols installed for .NET 4.0. I have never faced this, and I am also not sure there are not other causes, but you could try to install the .NET 4.0 SDK instead of the .NET 4.0 runtime only.
I am not sure exactly what setup you should install, but I would look around at http://msdn.microsoft.com/en-us/netframework/default.aspx .