Pergunta

I've got some native C DLLs which I'm calling from a Managed C++ Class library ("Rem"). In the "Rem" class library I've got one native C++ class (api) and one managed C++ class (API).

The managed class (API) is called from a C# console application for now (will be used in a web application later).

When debugging I can step through my native code just fine.

My problem is that when I'm debugging, I can't see the values of any variables other than simple types that are locally declared.

Function parameters are not available in the debugger and if I try to add them as a Watch it just says "error: identifier 'schema_name' out of scope" ('schema_name' is the variable name)

Any structs just show the value "{...}", both in the quick watch and the Watch-window. enter image description here

If I try and add a watch to a field in a struct I get the value "error: 'entryList.numItems' does not exist"

Stuff I've tried:

  • I've tried creating a Console application in Managed C++ and debug from that, same thing.

  • I tried unchecking the Tools->Options->Debugging->General->Managed C++ Compatibility Mode, then I couldn't step into the code at all (no symbols loaded for the breakpoints)

  • In the C# console app project, I've gone into Properties->Debug and checked "Enable native code debugging" (and unchecked it)

  • In the C++ class library I've gone into Properties->Debugging->Debugger Type and tried "Mixed", "Native", "Managed" and "Auto".

Any suggestions as to what I'm doing wrong?

Foi útil?

Solução

I guess you are using Visual Studio 2012 Update 2. In that case - this is a known bug with Update 2:

https://connect.microsoft.com/VisualStudio/feedback/details/783004/children-cannot-be-evaluated-on-c-cli-after-vs2012-update-2

Be careful though, the "workaround" of uninstalling Update 2 will leave you with a broken Visual Studio as seen in this bug-report (yes, Update 2 is broken):

https://connect.microsoft.com/VisualStudio/feedback/details/785396/uninstalling-vs2012-update-2-and-repair-of-vs-results-in-atl-files-missing

In case you are not using Update 2 this might not be the correct answer but it could help others who experience exactly this problem using Update 2.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top