3
votes

On 2 different computers (both Windows 10 Pro fully patched), I am running Visual Studio 2019 Pro (also fully patched).

If I create a new dummy Windows Forms project (VB or C#), edit and continue works great.

If I open a solution (composed of 25 projects) I have been working for years on the same computers, edit and continue is not working.

So what I understand is that there are settings on a per-solution basis that would affect the edit-and-continue. Of course, I build in Debug mode (not Release).

If I look at Tools-Options-Debugging-General, "Enable Edit and continue" is enabled. Also Tools-Options-Debugging-Just in time, the 3 options are selected.

Do you know what it could be?

2

2 Answers

3
votes

Edit-and-continue not working in VS2019 Pro (WinForms app)

Please try the following suggestions:

Suggestion

1) please make sure that you have uncheck the option Use Managed Compatibility Mode under Tools-->Options-->Debugging-->General

and also uncheck Require source file to exactly match the original version.

2) please uncheck the option Edit and Continue first, then close your old solution,

delete .vs hidden folder in the solution folder, every bin and obj folder in the solution.

After that, restart your solution, check the option Edit and Continue,then test again.

3) Right-click on every project-->Properties-->Build-->Advanced--> make sure that you set Debugging Information to full.

4) add this node in every xxx.csproj/xxx.vbproj files of your projects in the whole solution:

<PropertyGroup>
    <EmbedInteropTypes>false</EmbedInteropTypes>
</PropertyGroup>

Besides, since the structure of old projects from previous VS is different from the new VS2019. So it might have some problems.

So creating a new solution in VS2019 and then migrate the content from the old ones into the new projects might be a good choice. I think you could have a try.

2
votes

I found the issue. I am using PostSharp and that is messing with the edit-and-continue feature of VS2019. I wrote to the PostSharp support team waiting on what they have to say!