Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away

后端 未结 17 2138
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 16:12

Visual Studio 2010 kills (there is no other word) data in one of the arguments of the function in the unsafe block. What could cause this error? The following message shows

17条回答
  •  借酒劲吻你
    2020-11-29 17:11

    Check to see if you have a Debuggable attribute in your AssemblyInfo file. If there is, remove it and rebuild your solution to see if the local variables become available.

    My debuggable attribute was set to: DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints which according to this MSDN article tells the JIT compiler to use optimizations. I removed this line from my AssemblyInfo.cs file and the local variables were available.

提交回复
热议问题