6

I'm working with ASP.NET core 2.0. When debugging, I want to inspect the values of some variables on my razor views, however it's not showing the values when I mouse over them, it just shows the variables Type, like it would when not debugging.

I found the following question posted over 2 years ago with the same problem in VS2015, however the suggestions there have not worked for me, it also suggested it was a known problem, and was to be fixed in a VS2015 update.

'Use Managed Compatibility mode' under Tools->Options-Debugging didn't solve it.

I'm running VS2017 Community v15.7.2

Cannot See Values While Debugging ASP.NET Core

Ryan.
  • 77
  • 1
  • 5
  • Could you add a breakpoint to the specific line? Does it hit the breakpoint? As far as I know, the latest VS2017 version would be the 15.7.2 now, how about using the latest version? – Jack Zhai May 23 '18 at 10:04
  • Apologies, I read the wrong version number, that was my .NET Framework version number, oops. I am on 15.7.2. When setting a breakpoint it does hit it, but when hovering over a variable, it just shows the type, not its current value. This is only the case in my views, when the code steps into a controller or otherwise, I see the values, it's working as expected there. – Ryan. May 23 '18 at 23:56
  • You could right-click and choose "Add Watch". The Watch Window usually works perfectly - as a workaround until you get things solved. – Sam Axe May 24 '18 at 00:05
  • Thanks Sam, that does the trick for a workaround – Ryan. May 24 '18 at 03:40
  • @Ryan B., Glad to know that it works well even if it was a workaround, but as far as I know, datatips could visualize complex Data Types, if you want to view the value, we often use the debug watch windows. – Jack Zhai May 29 '18 at 02:48
  • This was working in 2013. I would like a way for this to work in 2017. It is a pain to have to move things to the watch window to see values. – Jordan Jun 20 '18 at 14:30

1 Answers1

6

As of 7/3 this appears to be a known issue with a fix in the works. See (now closed) Visual Studio bug #249225, and it's linked item Visual Studio Bug #246728. Consensus appears to be that this broke in the 15.7+ builds, with recommendations to use the watch window as commented above or downgrade to a 15.6 build as potential workarounds.

On the linked ticket, recent comment indicates it may be fixed with the 15.8 preview, so work is ongoing.

Hope this helps anyone else who wanders by!

Scott
  • 506
  • 4
  • 8