36

Update 1:

After Updating visual studio to version 2015 update 2 RTM the problem still exist.

Update 2 patch available 4/12/2016 :

Thanks to Patrick Nelson.

a patch has been released

You can download the patch here.

Update 3 8/16/2016:

Latest vs 2015 update 3 KB3165756 has the same problem do not update

Version Used:

Latest stable version on visual studio update 2 rc

Disabled all my extensions and also restarted my all settings

Steps to Reproduce:

  1. Install visual studio update 2 rc
  2. Create new project using asp.net mvc core template
  3. Debug the app

Expected Behavior:

To be able to debug the asp.net application enter image description here

Actual Behaviour:

I can't explore context of variable inside visual studio editor or immediate windows i get the following error in immediate windows

enter image description here error CS0103: The name 'myvariable' does not exist in the current context

Amir Jalali
  • 3,132
  • 4
  • 33
  • 46
  • Log a bug on Microsoft Connect. – Chris O Mar 29 '16 at 12:22
  • i already added an issue on github but seems stackoverflow be faster – Amir Jalali Mar 29 '16 at 12:23
  • 2
    If it reproduce in watch window\immediate window and data tip than it problem in the expression evaluator or in some other concord component [look here](https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Concord-Architecture). I don't think Roslyn has a relation to it. – Dudi Keleti Mar 29 '16 at 12:26
  • @DudiKeleti any workaound? – Amir Jalali Mar 29 '16 at 12:35
  • @1AmirJalali use your own concord components ;) but seriously, I don't have any magic workaround, sorry. – Dudi Keleti Mar 29 '16 at 12:43
  • Same issue here, if anyone find a work around it would be great – Juan Mar 29 '16 at 13:03
  • are you sure the assembly is build in debug mode, w/o optimizations? Make sure web.config contains `` – m0sa Mar 29 '16 at 20:03
  • Im using debug.writeline ahhhhhhh – Juan Mar 29 '16 at 20:59
  • @m0sa yes absolutely – Amir Jalali Mar 30 '16 at 06:09
  • Are you running against coreclr? I think I read somewhere that various debugging features are missing running against coreclr; switch to full clr if you haven't already? (i.e. `dnvm list` should show a full clr variant in use with the `deafult` alias). – Smudge202 Mar 31 '16 at 12:09
  • @Smudge202 I tested both no success – Amir Jalali Mar 31 '16 at 12:10
  • How did you switch between them and did you re-open the solution after switching? I'm currently installing the full Update 2 (upgrade from RC) so can't confirm, but I'm almost certain I can get debug support when on full clr. You can see which dnx is in use in the output window. – Smudge202 Mar 31 '16 at 12:12
  • @Smudge202 using dnvm use from property page and so on.... the second picture in question shows debugging on coreclr before update 2 – Amir Jalali Mar 31 '16 at 12:13
  • `dnvm use 1.0.0-rc1-update1 -r clr -p` ? Then re-open solution for changes to take effect, ensuring this setting is *not* overriden in the project properties? – Smudge202 Mar 31 '16 at 12:15
  • @Smudge202 i have done that – Amir Jalali Mar 31 '16 at 12:16
  • Fair enough. Sorry for the runabout; I'll test in update 2 shortly and let you know if it at least works on the non-rc update. – Smudge202 Mar 31 '16 at 12:17
  • 1
    I was having this problem with an existing code base and the solution in [Visual Studio 2015 Debugging: Can't expand local variables?](http://stackoverflow.com/questions/28730100/visual-studio-2015-debugging-cant-expand-local-variables) worked for me. – davidmdem Apr 01 '16 at 20:16
  • Why do you not update to Update 2 Release version? – TomTom Apr 02 '16 at 08:53

5 Answers5

20

using trial and error method i found a workaround for know that will bring back context debugging.

from tools >  options > debugging > general then enable

enter image description here

Amir Jalali
  • 3,132
  • 4
  • 33
  • 46
17

This is a bug that was introduced in Visual Studio 2015 Update 2. Essentially the debugger is unable to inspect local variables in dynamic modules. We released a hotfix for it today.

You can download the patch here. Documentation for the patch is here. Let me know if the patch does not fix your particular scenario.

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
Patrick Nelson - MSFT
  • 3,182
  • 1
  • 14
  • 13
2

and also (Use Managed Compatibility Mode - Enabled) please make sure json configuration file has this sections

"frameworks": {
    "dnx451": { }, 
    "dnxcore50": { }
},
Gencebay
  • 481
  • 2
  • 8
  • 15
  • 1
    Thanks. I add to add the "dnx451" reference as well in order for debuggin to work. Why is this? In my test solution I just want to compile for the dot net core. – aherrick Apr 05 '16 at 17:49
  • FYI, I have a project that only targets `dnx451` that exhibits this bug. I don't think that adding `dnx451` will always resolve this. The patch, on the other hand, fixed it perfectly. – Nate Barbettini Apr 19 '16 at 17:56
2

I found a solution for visual studio 2015 update 3, 14.0.25420.01 I just removed "debugType": "portable" from project.json Now it works for me.

azDev
  • 399
  • 5
  • 10
0

For Visual Studio Update 3 I reset my Visual C# settings and it worked.

Milad
  • 539
  • 8
  • 21