Edit & Continue doesn't work

ぃ、小莉子 提交于 2019-12-10 03:14:20

问题


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.


回答1:


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...



来源:https://stackoverflow.com/questions/39906338/edit-continue-doesnt-work

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