Reputation: 2251
When I use a watch I get this error message:
Cannot obtain value of the local variable or argument because it is not available at this instruction pointer, possibly because it has been optimized away.
It's really strange because I can only get intellisense in some parts of the application. The issue originally started when I couldn't step into my methods, so through searching. I turned off the just my code option in the debugger.
So far I have tried:
I have no idea what to do. Can anyone help?
EDIT:
Code where it happens:
public IList<string> PopulateFilterList(string selectedFields) {
IList<string> ExcludedFields = _homeRepository.GetExcludedFields();
Type t = typeof(Invoice);
return null;
}
I'm just trying to look at t
Edit: If I check the option 'Suppress JIT optimisation on module load' in the debugger I get intellisense. I get intellisense
Upvotes: 2
Views: 2307
Reputation: 699
In VS 2015 Community Edition
go to Debug->Options or Tools->Options
and check Debugging->General->Suppress JIT optimization on module load (Managed only)
if this doesn't work check that all projects in the solution have the option "Optimize code" un-ticked in the project properties.
Upvotes: 5