代码仅在调试器中执行 - MS Visual C#
我正在使用 Microsoft Visual C# 2008 Express Edition。 (我很抱歉 - 这更像是 MS Vis C# 可用性问题,而不是严格的编程问题......)
我写了一个小程序。 当我使用调试器在 MS VC# 中运行它时,一切都很好。 当我使用“单击一次”生成要部署的内容时(我使用“从 CD-ROM”选项而不是“从网站”),然后将其安装在我的计算机(或另一台计算机)上一切都很好,除了一段代码没有运行!
未运行的代码是 try/catch 循环的“catch”部分,我知道它会在应用程序中生成异常。 ,这在独立的已发布应用程序中不起作用。
我可以测试这个捕获,并要求用户在调试器中将
数据发送回我 我正在运行“快速版”,因为一位朋友提到我可能遇到部署“问题”,并且快速版似乎在部署选项方面受到限制,也许标准版就是我所需要的......(因为我可以使用 Windows Installer 而不是“单击一次”发布方法,
是否有意义?
-Adeena
这 (一位老命令行 unix C++ 程序员正在努力理解这个 Microsoft“视觉”世界)
I'm using Microsoft Visual C# 2008 Express Edition. (And I apologize - this is more of a MS Vis C# usability question than a strict programming question...)
I wrote a little program. when I run it in MS VC# with the debugger, all is well. When I use the "click Once" to generate something to deploy (I'm using the "from a CD-ROM" option as opposed to "from a website) , and then I install it on my machine (or a different machine) and all is well except a piece of the code doesn't run!
The code that isn't running is the "catch" part of a try/catch loop. I intentionally have a bug I know generates an exception still in the application so I can test this catch. The catch brings up a GUI and asks the user to send data back to me. In the debugger - this works fine. In the standalone, published app, this doesn't work.
any ideas?
I point out that I'm running the "Express edition" because a friend mentioned that I might have a deployment "issue" and it appears that the Express Edition is limited in deployment options and that maybe the Standard edition is what I need... (since I can use Windows Installer instead of the "click once" publish method).
Does any of this make sense?
Appreciate the help!
-Adeena
(an old command line unix C++ programmer who's struggling to make sense of this Microsoft "Visual" world)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这段代码是否在表单的构造函数/OnLoad 中? 有/没有调试器之间在这方面存在已知的差异。 修复方法通常是将代码推迟到 UI 线程处理事件为止。 例如:
Is this code in the constructor/OnLoad of a form, by any chance? There are known differences in this area between with / without debugger. The fix is usually to defer the code until the UI thread is processing events. For example: