Visual Studio 2015 / MVC 5: Attach to Process: Cannot obtain value of the local variable

901 Views Asked by At

I can connect to the w3p process on my IIS box just fine. I can step through, although it seems to skip some areas. Also, when I try to view a variable value, I get:

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.

enter image description here

I've seen MANY answer on this subject, but they all are geared toward local debugging. I am attaching to the server and getting this.

I have the source code and am working from that project. Does it matter if I publish the app to the server with the config set to 'Release'? release

1

There are 1 best solutions below

0
On BEST ANSWER

ANSWER: I switched it to 'debug' when publishing and now I can see the variables. I previously thought it was how it was set in the project properties, but it's how it's published to the server that makes the difference when publishing.