Can't inspect variables while debugging CLI project referencing .Net Standard Lib

こ雲淡風輕ζ 提交于 2019-12-11 02:08:27

问题


We are facing the same issue as this question asked on the visual studio community by Laurent: LINK.

Problem: If we try to debug the C++/CLI project, all variables defined in .Net Standard library inspection fails with the message :

Unable to resolve reference to type 'System::ValueType' in assembly 'System.Runtime'.

When the project is compiled below warning is displayed:

warning C4691: 'System::Object': type referenced was expected in unreferenced assembly 'netstandard', type defined in current translation unit used instead

And

note: This diagnostic occurred while importing type 'App::Calc::Models::InputDataContext ' from assembly 'AppLib.Calc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a58edc04d4501d54'.

Steps to reproduce:

  1. Create a .Net Standard (2.0.0) project containing a Struct/Class.
  2. Create a C++/CLI project using .Net Framework 4.6.1 (Same problem in 4.7.1) and include the previously created Struct/Class into a class.
  3. Run and try to add the variable to the Watch window.

We have a large CLI layer and this going to be painful if we can't inspect the variables while debugging.

So my question is it's been around six months since the question was asked and it hasn't been resolved yet. I want to know if anybody else has encountered the same problem and what is the workaround if any.

Update: Just received the following comment from the Visual Studio Feedback system.

A fix for this issue has been internally implemented and is being prepared for release. We'll update you once it becomes available for download.

Solved: The issue is now solved by the Visual Studio Team.

A fix for this issue has been released! Install the most recent release from https://visualstudio.microsoft.com/downloads/. Thank you for providing valuable feedback which has helped improve the product.

来源:https://stackoverflow.com/questions/55946852/cant-inspect-variables-while-debugging-cli-project-referencing-net-standard-li

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!