使用VS2010调试Linqpad中执行的代码

发布于 2024-09-27 17:42:16 字数 254 浏览 0 评论 0原文

我正在尝试将 VS2010 调试器附加到 Linqpad,以便当我使用 c# 项目中的类时,我可以添加断点并使 Linqpad 执行停止。

但这不起作用,Linqpad 愉快地执行并完成,而没有到达我的断点。

现在,我在 Linqpad 上读了一点,它在自己的进程中执行每个“查询”,这是否以任何方式欺骗 VS2010,以便我附加到的进程不是执行我的对象的进程?

如果是这种情况,有没有办法解决这个问题,以便我可以使用 Linqpad 进行调试?

I am trying to attach VS2010 debugger to Linqpad so that when I use classes from my c# project I can add breakpoints and have Linqpad execution halt.

But this does not work, Linqpad happily executes and finishes without hitting my breakpoints.

Now, I read a bit on Linqpad and it executes every "query" in its own process, does this in any way fool VS2010 so that the process I attach to is not the one executing my objects?

And if that is the case, is there a way around this so that I can get debugging with Linqpad to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

败给现实 2024-10-04 17:42:16

发现,由于 Linqpad 为每个查询窗口创建一个新的应用程序域,因此您当前无法将 Visual Studio 直接绑定到它。

您必须在源代码中设置 debugger.break() 才能触发打开应用程序域的请求调试器。

这不是最好的解决方案,因为这意味着我必须来回更改源并且无法使用正常的断点,但它可以工作。
我自己找到了一个更好的。

您无法将 Visual Studio 连接到 LinqPad,但至少可以跟踪 VS 项目中的代码。

不幸的是,您无法通过这种方式跟踪代码的 linqpad 部分。

如果有人应该找到更好的解决方案,请与我分享。

找到了一个具有更好解决方案的新线程

如何在 Visual Studio 调试器中调试 LinqPad 查询?

Found out that since Linqpad creates a new appdomain for each query window you cannot currently bind visual studio to it directly.

You have to set debugger.break() in your source code to trigger a request for opening a debugger.

This is not the best solution as it means I have to change the source back and forth and cannot use normal breakpoints but it works.
Found a better one my self.

You can not attach Visual Studio to LinqPad and at least trace the code in your VS project.

Unfortunately you cannot trace the linqpad part of the code thiw way.

If anyone should find a better solution, please share it with me.

Found a new thread with a better solution

How to debug LinqPad query in Visual Studio Debugger?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文