Visual Studio编辑并继续无法正常工作 [英] visual studio edit and continue does not work

查看:556
本文介绍了Visual Studio编辑并继续无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,它是一个混合项目(以前是一个Web窗体项目,然后我们对其进行了修改,以使用mvc模式)。

In my project which is a hybrid project (in previous it was a web forms project that then we modified to use mvc pattern).

现在,我希望在调试模式下,我想更改cs文件中的内容,然后
然后运行更改后的代码。

Now I want that in debug mode, I want to change something in my cs file, and then I want the changed code to run.

我尝试过启用和禁用工具->选项->调试->编辑并继续复选框。

I've tried enabling and disabling tools -> options -> debug -> edit and continue checkbox part.

启用该功能后,在调试时无法更改项目中的代码。
禁用该选项后,我可以更改代码,但不会影响正在运行的部分。例如,

When it is enabled I can't change code in my project while debugging. When it is disabled I can change code but it does not affect on running part. for example.

  int i = 0;
  if(i == 1)
    return 1;
  else
    return 2;

在调试模式下,我将 i 更改为 1 ,但是它在以下代码中仍然返回 2 ,仅当我停止并重新运行调试器时,它才会生效

In debug mode I changed i to 1 but it stil returned 2, in the following code, only when I stop and re-run the debugger it takes affects.

 int i = 1;
  if(i == 1)
    return 1;
  else
    return 2;

BTW我正在使用Visual Studio 2010版本。

BTW I am using Visual Studio 2010 version.

推荐答案

这不是我的问题;运行VS2017 RC2,我发现在工具->选项->调试->即时下,我的托管代码被取消选择。

This wasn't my problem; running VS2017 RC2, I found that under Tools -> Options -> Debugging -> Just-In-Time - my "Managed Code" was deselected.

有一个警告另一个调试器已将自己注册为即时调试器。请通过启用即时调试或运行Visual Studio修复进行修复。

There was a warning "Another debugger has registered itself as the Just-In-Time debugger. Fix by enabling Just-In-Time debugging or running Visual Studio repair".

我还没有注册任何其他调试工具!所以不知道为什么它没有被选中...

I had not registered any other debugging tools! So no idea why it unticked...

所以解决的方法只是在 Managed框中打钩...。

So the fix was simply to tick the "Managed" box....

这篇关于Visual Studio编辑并继续无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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