9

I'm trying to get managed Edit & Continue working (in Visual Studio 2015 v14.0.25425.01 update 3) and it's giving me the dreaded dialog, "Changes are not allowed in the following cases:"

  • Attached to a process that does not support Edit and Continue on attach.

    1. I'm using IISExpress v10.0.14358.1000, on Windows 10.0.10586, x64.
    2. I have 'Use the 64 bit version of IIS express for web sites and project' checked in Tools->Options. (although, i also get the same error with 32-bit iisexpress)
    3. all my code is compiled 'Any CPU'
  • The code being debugged was optimized

    1. Nope, the all the code is built with the DEBUG constant set, and no optimizations.
  • The assembly being debugged is loaded as domain-neutral

    1. Nope, i checked with Process Explorer, the assembly isn't loaded DomainNeutral.
  • The assembly being debugged was loaded through reflection.

    1. Not sure about this, but it's a regular ASP.NET MVC 5 app.
  • Intellitrace events and call information is enabled.

    1. Nope, intellitrace is disabled in Tools->Options->Intellitrace.
  • The .NET Runtime this program is running on does not support edit and continue.

    1. Not sure. It's built against ".NET Framework 4.6.1", and the first symbol load is "'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'"

some other things:

  • in the 'Web' project settings, both the 'ASP.NET' and 'Enable Edit & Continue' checkboxes are set (and none of the others).
  • i have 'Edit and Continue' enabled in the Debugger settings.
  • i have compatibility modes disabled in the Debugger settings.
  • i have tried deleting my .suo files and the .vs directory, cleaning out my temporary directories, doing a full rebuild

what else can i try?

PS. if anyone on the VS debugger team is reading this, can i ask a favor? please kill this dialog and replace it with something that indicates the actual cause of the problem. You have the debuggee right there, and the solution, you can determine which of these is causing the problem and you can have a button which fixes the problem with a single click.

Spongman
  • 9,665
  • 8
  • 39
  • 58
  • Can you install the latest KB? https://msdn.microsoft.com/en-us/library/mt752379.aspx. Not change any VS settings, I mean just use the default VS settings, how about the result? I test it as your steps, I couldn't repro it in my side. I just use the default MVC sample and the latest VS2015. – Jack Zhai Oct 07 '16 at 03:12
  • thanks for the tip, but unfortunately the update doesn't make a difference. – Spongman Oct 07 '16 at 19:40
  • who downvotes this? – Spongman Oct 07 '16 at 19:49
  • no idea ... i am trying to fix this on my machine right now so glad you asked it. – K7Buoy Feb 17 '17 at 14:06
  • The Debugger settings were my issue. They were stored in my csproj.user file. Deleting that file and closing/reopening the solution will restore those to the default settings (which are what I needed). I normally delete the .vs, bin, and obj folders when working through random issues. I should probably add the csproj.user file to my list. – kevinpo Mar 31 '22 at 13:54

1 Answers1

10

ok, for posterity. it turns out that the problem was caused by an environment variable (which presumably was configured by the profiler at some point):

COR_ENABLE_PROFILING=1

removing this fixes edit & continue.

it would be great if the error popup could mention this, or even detect it and give you an option to fix it for you...

Spongman
  • 9,665
  • 8
  • 39
  • 58
  • Glad to know that you have resolved this issue, please mark it as the answer, so it would be helpful for other members who meet the same issue as yours. – Jack Zhai Oct 10 '16 at 01:25
  • @Spongman - Have a look at https://connect.microsoft.com/VisualStudio -- it's possible to submit a bug or feature request there. Sounds like a good proposal. – CJBS Aug 18 '17 at 18:12