Edit and continue feature stopped working in Visua

2019-01-13 19:58发布

The Visual Studio Edit and Continue feature stopped on Visual Studio 2010, and I don't know what has caused the problem.

I am working on a Windows application program using C#. This application was initially developed in Visual Studio 2008, and later upgraded to Visual Studio 2010.

Everything was working fine, including Edit and Continue, until I upgraded the .NET Framework from 3.5 to 4.0.

Now when I use debug mode, changing any line of the code in the IDE results in the following message:

Edits were made which cannot compiled. Execution cannot continue until the compile errors are fixed.

Actually, there are no compilation errors, and I must restart the Visual studio to get the updates to run.

How can I get Edit and Continue to work again?

18条回答
欢心
2楼-- · 2019-01-13 20:20

For me this was caused by Nuget failing to download a package (built for Net Framework) to a Net Standard project that was being referenced. Nuget entered an infinite loop (look in the output window).

The solution was to turn off the 'automatic package restore' setting see: https://developercommunity.visualstudio.com/content/problem/26638/nuget-infinite-loop.html

to access this setting Tools > Options > NuGet Package Manager > General

查看更多
Emotional °昔
3楼-- · 2019-01-13 20:22

I had some Excel file "embed interop types" == true. When I changed it to false, edit and continue started working.

查看更多
欢心
4楼-- · 2019-01-13 20:23

In Visual Studio 2015, I've deleted the .vs folder (where the new style .suo file is), deleted all bin and obj, and also uninstalled Resharper 2015. Edit and Continue is back.

(side note: intellisense is now showing autocomplete almost instantly, whereas it was taking 2 to 5 seconds before, maybe resharper's fault, and maybe unrelated...)

查看更多
聊天终结者
5楼-- · 2019-01-13 20:24

In the Solution Explorer view, right-click on each reference of References, choose Properties. In the Properties view, sign False to the field of Embed Interop Types. This works for me.

查看更多
别忘想泡老子
6楼-- · 2019-01-13 20:28

In my case, what worked was unchecking "Require source files to exactly match the original version" in Debugging options. VS Community 2017 here.

查看更多
Ridiculous、
7楼-- · 2019-01-13 20:30

I had used Microsoft's profiler yesterday and afterwards my "Edit and continue" feature got away. I finally realized after hours of frustration that I needed to execute VsPerfCLREnv /globaloff command from command prompt and restart my computer. Now I have my Edit and continue future back. It has nothing to do with target platform by the way. It works with target platform set to Any CPU without any hassle.

查看更多
登录 后发表回答