from: https://stackoverflow.com/questions/8311303/cannot-obtain-value-of-local-or-argument-as-it-is-not-available-at-this-instruct

In visual Studio 2017 goto Debug->Option then check Debugging->general-> and check this option. Suppress JIT Optimization on modual load (Managed Only)