Cannot see values ​​during debugging

I am using Visual Studio 2015, and when I hit the breakpoint, I cannot get information about the values ​​of the variables.

  • When falling over a variable, nothing appears.
  • In the immediate window or watch, I get:

    error CS0648: '' is a type not supported by the language 

This happened all of a sudden, since it worked until yesterday.

I tried several things, including resetting all user settings, deleting * .user files, restarting Visual Studio, and even restarting Windows.

What else can I try?

Update: I wrote a blog post about this issue and how to reproduce it.

+6
source share
3 answers

This is the bug that is currently being monitored by aspnet / Home issue # 955 .

Console application for reference:

REPRO

  • Open VS2015 (Windows 10, ASP.NET 5 Beta 7)
  • Click File> New> Project> Web> Console Application (package)> Ok
  • Modify Program.cs to display the code snippet below.
  • Add access point immediately after Console.WriteLine(a);
  • Run the project
  • Right-click variables a and b , click Add Clock

CODE

 public void Main(string[] args) { const int a = 3; int b = 4; Console.WriteLine(a); } 

EXPECTED

The viewer displays the values ​​for variables a and b

ACTUAL

The viewing window The column of values ​​for variables a and b displays:

error CS0648: '' - type not supported by language

NOTES

  • The value of a is spelled correctly in the console.
  • Removing const from fragment returns to EXPECTED bevahiour
+6
source

You won’t believe it, but it seems that it has something to do with the const expression that I had. Removing const and using a variable resolved the issue.

How strange. Failed to play on a simple console application. The problem originally occurred in an ASP.NET 5 web application.

Update: For more details, see the message which also explains how to reproduce the problem.

+10
source

I had one variable that had CONST, and as soon as I deleted, all my types appeared and had values ​​in them.

0
source

All Articles