Unable to set the next statement. The next statement cannot be changed at this time

百般思念 提交于 2020-01-03 13:02:34

问题


I suddenly started experiencing this error in Visual Studio 2015 and 2017, when trying to move the yellow cursor (next statement) in debugmode.

The code I want to move over is nothing special (i.e does not include any try-catch and/or exception statements) and stepping through the code (F10, F11) works normally.

Here is a code sample:

protected void Page_Load(object sender, EventArgs e)
{
        if (!IsPostBack)
        {
            ddlCountry.SelectedIndex = 0;
            ddlCountry.DataSource = new List<string>() {"Germany", "Japan"};
            ddlCountry.DataBind();
        }
}

The solution contains multiple web projects and console projects, but the error does not occur in the console projects - only in the web projects. I.e in the console projects, I can move the yellow cursor with no problems.

When I try to do the same in any other solution, I have no problems, so it seems to be something related to my current solution.

These are the things I tried so far:

  • Started Visual Studio as admin
  • Tried to move the yellow cursor in both vs2015 and vs2017 (same project, same file) - same result
  • Visual Studio 2015 repair installation
  • Start Visual Studio, using the following command "devenv.exe /resetuserdata", in order to try to reset all userdata
  • Tools --> Import and Export Settings --> Reset all settings
  • Deleted the .suo file

All the suggestions I found on Google have not proved very helpful in solving this issue, so if anyone here can assist, I would be really glad.

来源:https://stackoverflow.com/questions/49905730/unable-to-set-the-next-statement-the-next-statement-cannot-be-changed-at-this-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!