问题
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:
- Create a .Net Standard (2.0.0) project containing a Struct/Class.
- 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.
- 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