Andrew Kilburn
Andrew Kilburn

Reputation: 2251

Visual Studio 2015 intellisense not appearing during debug

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:

  1. Restart machine
  2. Clean + Rebuild VS2015
  3. I have turned off all optimisations for debugging

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

Answers (1)

Ben Jones
Ben Jones

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

Related Questions