Reputation: 29421
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.
Upvotes: 6
Views: 7947
Reputation: 29421
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.
Upvotes: 10
Reputation: 9806
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 bevahiourUpvotes: 6
Reputation: 1
I had one variable that had CONST and once I removed that all my types showed up and had values in them.
Upvotes: 0