Recently we were debugging a D365 plugin in Visual studio 2017, able to hit the debugger but unable to get values to any of the variables. Getting the above error while debugging with the solution being in Release mode.
Changed from the release mode to debug mode, deployed the solution and then able to debug and get the values.
Please refer to below posts for more information.
Cannot obtain value of local variable
Hope this helps someone…