Edit and continue not working for asp.net core 3.0 with VS 2019 (C#)

1

I have VS 2017 latest Community edition installed on my machine. I was able to edit any class file and razor pages (cshtml) of my ASP.Net Core web application while debugging. I installed VS 2019 Community edition (and updated till 16.3.7) and opened same project and converted to .Net 3.0. While debugging, I tried to edit the code and welcomed with below error showed in Error List panel - ENC2011 - Changes made in project ‘MyApp’ will prevent the debug session from continuing: Changes are not allowed on the current module.

Please see below for more information if needed -

VS 2019 Community 16.3.7 edition (No preview installed earlier) .Net Core 3.0 (No preview installed earlier) I opened my older project having 2.1 framework and still experienced same issue in VS 2019. I created simple console app and was ABLE to edit and continue in VS 2019. I created another ASP.Net core web application with .Net Core 3.0 and experienced same issue. Edit and Continue checkbox is checked under Tools->Options->Debugging->General. Removed native debugging. Checked the Configuration profile and that was set to Debug and not Release. I have VS 2017 and 2019 installed side by side (both community edition updated till date) Language is C#. Can I please know the solution?

Thanks in advance!

Below is full VS 2019 info that is copied from help - Microsoft Visual Studio Community 2019 Version 16.3.7 VisualStudio.16.Release/16.3.7+29424.173 Microsoft .NET Framework Version 4.7.03056

Installed Version: Community

Application Insights Tools for Visual Studio Package 9.1.00913.1 Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019 16.3.286.43615 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.3.286.43615 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.3.286.43615 Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.3.286.43615 Azure Functions and Web Jobs Tools

C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.0.83+gbc8a4b23ec Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

NuGet Package Manager 5.3.1 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61908.27190 Microsoft SQL Server Data Tools

TypeScript Tools 16.0.10821.2002 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823 Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

Jay

Posted 2019-11-05T11:33:29.947

Reputation: 11

Answers

0

I literally every time updated my VS 2019 to see if issue is resolved or not. Couple of days before I updated again to 16.4.5.

Finally I found that some process had set "COR_ENABLE_PROFILING" flag in environment variables under System and User - which caused my Edit and continue to not work in VS 2019. For this I tapped Windows key and then typed "edit environment variables for your account". Once opened, I removed COR_ENABLE_PROFILING variable from both user and system variables.

P.S.

I found which profiler caused issues with my system. I had downloaded Stackify Prefix on my machine earlier and ran that. It added COR_ENABLE_PROFILING flag which caused Enc to stopped working in VS 2019. I don't know why VS 2019 is looking for that flag.

enter image description here

Jay

Posted 2019-11-05T11:33:29.947

Reputation: 11

1

This is a bug in Visual Studio 2019. Microsoft says they have released a fix in VS Preview: https://developercommunityapi.westus.cloudapp.azure.com/comments/807186/view.html

Caio Proiete

Posted 2019-11-05T11:33:29.947

Reputation: 111

Hey Caio, I think the bug that is mentioned in the document is totally different bug than what my issue is. Also I am able to edit and continue for any other project type but not with asp.net core web app. Unfortunately I can't install preview on my machine but if MS will fix it in 16.4 version and I would be able to edit and continue with my asp.net core, then I will make this as answer. Thanks! – Jay – 2019-11-06T05:38:04.187

Doesnt seem to work in VS 2019 16.4.0 Preview 6, even in a 2 line console app. – salek – 2019-11-26T02:10:24.047

Just installed VS 2019 16.4.1, still not working. I have raised the problem ticket with Microsoft. – Jay – 2019-12-11T05:01:57.873