How to display native types when debugging in VS2012 for mixed mode C++/CLI MFC app - visual-studio-2012

Possible duplicate of this question.
I have a MFC project that uses /clr switch and some C++/CLI code to use a .Net component. Originally this was on VS2005.
On upgrading to VS2012 Update 2, during debugging, no values or types were shown for native data types. I learned that a new mechanism for native data type visualization (natvis) was introduced in VS2010 and extended / enhanced in VS2012. Following the information on that page, I unchecked Managed C++ Compatibility Mode and C/C++ edit and continue. After this, breakpoints became disabled and stopped being hit. Using "Only Managed" debugger, the breakpoints were hit but no values were shown.
Finally, I used "mixed" debugger and used __debugbreak() to force a break. This resulted in only integer values being shown ONLY if they are local autos; and data types were picked up correctly. However, std::string or CString values are not shown and instead their type is shown in value column. Similarly, pointers, class members, or functions argument values are not shown and type information, Undefined value, or out of scope is shown in the value column.
The behavior is consistent across autos, locals and watch windows as well as mouse hover on symbols.
How do I get the native data types to display their values during debugging in VS2012 mixed mode C++/CLI MFC application.
I have read this question and verified that all symbols have been loaded in modules window.
Apparently, Microsoft is aware of the issue and the upcoming CTP of Update 3 should fix it.
Additionally, why do I need to use __debugbreak()?

A couple of days ago, Microsoft released a Visual Studio Service Pack 3 RC which may help (installing it myself right now). Here is the link: http://www.microsoft.com/en-us/download/details.aspx?id=38832

Re-install Visual Studio 2012 and do not apply Service Pack 2.

Related

Local window shows empty Variables while debugging SSIS package in VS Data tools 2012

This has been bothering me for a long time. I am unable to debug SSIS package efficiently because the Variables collection of SSIS package is always empty.
SS of Locals window showing blank value for Variables collection variable
Updated after userfl89 gave an alternative solution
Also, the watch window is showing unable to evaluate the expression error message
I found a similar issue in general VS development environments (C#, VB.NET) and tried suggestions/answers. For example, changing Debug->Options->Debugging-> check Managed c++ compatibility mode (see ss below) but it did not work for me.
SS of debugging setting:
I have also tried to run in both 64bit mode and 32bit mode, but this also did not work. However, I can see variable values inside script task written in C# code. It has become a painful task to debug packages. Please someone help.
Environment:
Windows 7 Enterprise (64bit)
Visual studio 2012 for Data Tools (version 11.0.6xxx)
.Net Framework 4.6
I'm assuming that you already set a breakpoint? When the package hits the breakpoint, on the top menu go to Debug > Windows > Locals and from here expand the top variables node, however it looks like you've already done this. You can also view the variables values in the Watch windows by typing the name of the variable in the Name field when the breakpoint is reached. This will only be the variable name, not the #[User::Variable] syntax.

Extend Visual Studio functionality for Installshield ISPROJ Project type

InstallShield must be the crappiest "industry standard" application in existence, for reasons too numerous to enumerate here. However, one of those deficiencies is something I'd like to be able to fix, and with my first foray into writing an extension for Visual Studio (currently using 2015 version).
InstallShield has created a .isproj type, to allow integration with Visual Studio. This allows a developer to create an installer that references the output of a project as the files to include in the installer (rather than having to manually select individual files to include). This works well enough as long as the .isproj is being built in Visual Studio, and in a solution that references the project for which you need the output.
However, I also have an automated build for my installer projects, that we run on a build server using MSBuild. When attempting to build this way, we were getting completely opaque error messages indicating that the project output references above couldn't be resolved.
As with all InstallShield errors, Googling for answers turned up nothing except for multitudes of other people having the same problem. So I decided to dig into the plain text of the .isproj to see what I could find.
As it turns out, the .isproj type is a just a regular MSBuild script, and it even has lines commented out that explain options that can be added to the project; one of those things that can be added is an ItemGroup containing ProjectReference nodes. Manually adding the nodes helped solve the problem. Command-line build now works.
However, I am dissatisfied with a) having to manually type this stuff in, b) having no visual representation of what projects are being referenced, and c) not finding out about a problem until the build fails. So, I would like to be able to extend Visual Studio to help me with this. Here's what I'd like to do:
1) Add a "References" node to the project in Solution Explorer that acts like the References node for any normal .csproj.
2) Restrict the available References to other projects in the the current solution.
3) Visually represent a project with missing references (e.g. by underlining the project name with a colored squiggly, as with errors/warnings), and potentially failing the build if missing (depending on whether I want to treat it as an error or a warning; TBD).
To these ends, I've downloaded MPF for Projects - Visual Studio 2013, which provides an SDK for creating a new project type.
However, before digging too deeply, I need to know if it's even possible to EXTEND an existing project type, as described above, as I obviously don't have InstallShield source code. Also, any links or guidance as to a starting point for doing so would be greatly appreciated.

Visual Studio 2012 - Locals not shown

I am using Visual Studio 2012 with the Intel Fortran Compiler XE 13.0 (from Parallel Studio 2013) to code in Fortran.
When debugging a project, the "Locals" and "Auto" windows don't show any variable. Similarly, when hovering over a variable name in the code, I don't get any datatip showing its value. Lastly, when trying to evaluate a variable or expression in the Watches I always get an "Unable to evaluate expression". So, as far as I understand, there's some problem involving debugger symbols or something like this.
Here's what I tried:
restarting VS and Windows
creating a new solution with default configuration
checking the Debugging options for any obvious setting which could case this
followed this answer, even if it looks like it's for a slightly different problem (VS recognizes a local variable, but saying it's out of scope)
repairing my Intel Parallel Studio XE 2013 installation
I never enabled optimization. Here's a screenshot so that you can clearly see what it's going on here.
P.S: as a last hint, I found a similar bug affecting VS2010, but 1) yeah, I've got VS2012 and I suppose it should have been fixed 2) it affects C++ (don't know if this matters though) 3) the patch is not directly available online.

How to get XML comments to appear in Visual Studio Class Wizard decriptions

I have put XML comments in a C++ source file that IntelliSense appears to pick up and use. It creates a project xml file, and IntelliSense works when I edit the original source file (showing me comments when I'm selecting a member function or entering parameters).
But, when I go to the Class Wizard in Visual Studio 2012 Express, the entered descriptions don't appear anywhere (on the methods, for example, down at the bottom of the dialog, where description remains sadly empty). For that matter, IntelliSense only works in the original file(s), so when using a call in a separate file, none of my XML comments get picked up. Why does it only work in the original source file? What have I neglected to do?
I don't think you've neglected to do anything, unfortunately.
The Class Wizard was built long before Visual Studio supported XML doc comments, so it's more likely that no one remembered/cared to go back add support for them to the Class Wizard dialog.
In my experience, although it sounds like you've had slightly better luck, XML doc comments are not particularly well supported when using C++. For example, VS 2012 was the first version to support them in IntelliSense (and even that is incomplete). You get nothing in VS 2010 and earlier versions, despite the fact that they'll happily output a project XML file. That pathetic lack of support, combined with the angle bracket tax, drove me to switch to Doxygen when writing C++ code.

Reference defining all Visual Studio 2012 Solution Explorer Icons

I have been unable to find a reference to the new Visual Studio 2012 Solution Explorer icons. From time to time, some of our .sql files icons change as with the one with the yellow triangle below. Does such a reference exist? If not, what does this yellow triangle icon mean?
I don't have a reference for all the icons. However, I believe the yellow triangle indicates that there are warnings associated with referenced assembly.
View the warnings by going to Error List (usually in the at the bottom of Visual Studio or in the menu VIEW - Error List or by Ctrl + W, E).
Then click on the Warnings tab. There should be one or more warnings about the assembly. Usually there are missing or conflicting references or something like "the primary reference X could not be resolved because it has an indirect dependency on Y which has a different version of the framework.
This could happen if you reference an assembly that is built for a new version of the .NET framework. (Example your assembly is using .NET 4.0 but the assembly you want to use is built with .NET 4.5).
The icon indicates a document warning.
Follow this link Visual Studio image library. The download contains a document listing of the icon and what it means.
As Chris Weber says, the problem may arise if you add a new project to your solution, and the new project targets a higher version of the .NET framework than the other projects in the same solution.
Fix: Right click your newly added project, go to properties. On the left handside, find the topmost tab called "Application". In the right frame, you should see a dropdown where you can set "Target Framework". Make sure this is the same version as the rest of your solution.

Resources