I'm using Visual Studio 2015, and when I hit a breakpoint, I cannot get any info on the values of variables.
In Immediate Window or Watches, I get:
error CS0648: '' is a type not supported by the language
This happened all of a sudden, as it used to work until yesterday.
I've tried a few things including resetting all user settings, deleting *.user files, restarting Visual Studio, and even restarting Windows.
What else can I try?
Update: I've written a blog post about this problem and how to reproduce it.
The most commonly used way to look at variables is the DataTip. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable.
set the break point on the dataset/datatable(f9 shortcut key for break point) and run your application (f5 is the shortcutkey ) When the break point comes mouse hover the dataset/datatable click on the glass shown in the hover image in visual studio . Note : check compilation debug="true" is true in web config .
You won't believe this but it seems that this is somehow related to a const
expression I had. Removing const
and using a variable solved the problem.
How weird. Didn't manage to reproduce on a simple console application. The problem originally occurred on an ASP .NET 5 Web Application.
Update: see more details in my blog post which also explains how to reproduce the issue.
This is a bug currently being tracked by aspnet/Home issue #955.
Console Application repro for reference:
REPRO
Program.cs
to reflect code snippet below.Console.WriteLine(a);
a
and b
click Add WatchCODE
public void Main(string[] args)
{
const int a = 3;
int b = 4;
Console.WriteLine(a);
}
EXPECTED
Watch window displays values for variables a
and b
ACTUAL
Watch window Value column for variables a
and b
displays:
error CS0648: '' is a type not supported by the language
NOTES
a
is written correctly to Consoleconst
from the snippet reverts to EXPECTED bevahiourIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With