I have a .NET core project and an Xunit project in a solution, where I've all of a sudden gotten huge problems with debugging. This seems to have coincided with installing update 2 yesterday.
When debugging and hitting a breakpoint, only a select few parameters show up in locals, autos, watch or are reachable from immediate window. I think, but haven't verified 100%, that the variables I can access are globals and ones passed as parameters to the function.
For instance, look at part of this test:
public void UniTest4()
{
var s = @"{
""id"": ""0001"",
""type"": ""donut"",
""name"": ""Cake"",
""ppu"": 0.55,
""batters"":
{
""batter"":
[
{ ""id"": ""1001"", ""type"": ""Regular"" },
{ ""id"": ""1002"", ""type"": ""Chocolate"" },
{ ""id"": ""1003"", ""type"": ""Blueberry"" },
{ ""id"": ""1004"", ""type"": ""Devil's Food"" }
]
},
""topping"":
[
{ ""id"": ""5001"", ""type"": ""None"" },
{ ""id"": ""5002"", ""type"": ""Glazed"" },
{ ""id"": ""5005"", ""type"": ""Sugar"" },
{ ""id"": ""5007"", ""type"": ""Powdered Sugar"" },
{ ""id"": ""5006"", ""type"": ""Chocolate with Sprinkles"" },
{ ""id"": ""5003"", ""type"": ""Chocolate"" },
{ ""id"": ""5004"", ""type"": ""Maple"" }
]
}";
var token = yayson.MakeToken(s);
When I break on the last line, I can't to reach the variable "s". I have looked for others with similar problems, and have then seen suggestions that this may be due to building with certain compiler optimizations. But is that really the case for me? Shown below are the build settings for my Xunit project. My business project looks the same, excep for the top checkbox being checked (which it also was, working just fine, prior to the VS update).
What can I do to find local variables again?