9

I am encountering a strange issue. i have all the latest updates in my PC. My OS is Windows 7. Can anyone help me out with this? I have tried resetting the Visual studio.

And here is the exact problem blown up to make it easier to see:

Close-up on the problem

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
Madan
  • 254
  • 2
  • 9
  • 2
    "Why is the debugger pretty-printer running in C++ mode while stepping through C# code?", apparently – Ben Voigt Mar 05 '12 at 15:57
  • 2
    Can you show the call stack window also please? It has a column for Language that might be, well, interesting. – Ben Voigt Mar 05 '12 at 17:54
  • Possible duplicate of [How do I change my development environment from C++ to C# in Visual Studio 2008?](http://stackoverflow.com/questions/967309/how-do-i-change-my-development-environment-from-c-to-c-sharp-in-visual-studio)? – CodeCaster Mar 05 '12 at 17:57
  • 3
    @CodeCaster That's an entirely different question: choosing the C++ settings has no effect on debugging C# code. (I prefer the C++ keybindings, even when I'm dealing with C# code.) –  Mar 05 '12 at 18:04
  • Have you tried disabling addins to see if the issue goes away? – John Koerner Mar 06 '12 at 20:42
  • Did you attach with a mixed mode debugger? – Phil Price Mar 07 '12 at 18:27
  • What's the C++ syntax? I'm not seeing it. – Esteban Araya Mar 08 '12 at 19:27
  • @EstebanAraya `System::Collections::Specialized::NameObjectCollectionBase^` –  Mar 08 '12 at 19:31
  • 4
    This was reported as a bug: [visual studio debugging c# as c++](http://connect.microsoft.com/VisualStudio/feedback/details/540228/visual-studio-debugging-c-as-c), but apparently it was reproduced. You might see if you can reproduce the issue using the Visual Studio 11 Beta; if you can, it would be worth opening another bug for the issue. I agree, this is most unusual. – James McNellis Mar 08 '12 at 19:31
  • 2
    I've gone ahead and added a blow-up so that people can see the problem without assuming hexadecimal is something specific to C++... – user7116 Mar 08 '12 at 19:33
  • possible duplicate of [Why does debugging a C# project display C++/CLI symbols?](http://stackoverflow.com/questions/9910622/why-does-debugging-a-c-sharp-project-display-c-cli-symbols) – Rachel Mar 04 '14 at 19:14

4 Answers4

3

I had the exact same issue. To confirm, look in the call stack at a c# stack frame. For me it said C++ instead of C#. For anyone else with this problem:

I fixed it by looking at the compatibility settings for VSLauncher.exe, Devenv.exe, and the shortcut to Devenv.exe. One of them (VSLauncher.exe) has compatibility mode set to Windows XP. I turned that off and it was fixed.

Jason
  • 31
  • 1
2

The Hex display is because you chose that option (clicked on the toolbar), click on it again to switch back to the normal display. The C++/CLI type is not related to the Hex dispaly issue though.

enter image description here

Sofian Hnaide
  • 2,284
  • 16
  • 13
1

I ran into this issue as well, the debugger picked up c# and c++ in all c# projects. I'm running windows 7 64 bit.

I resolved this issue by going to the compatibility tab of the properties of the shortcut. It was checked as running as windows xp service pack 3. I unchecked that and still kept run as administrator checked. Suddenly my debugger picked all of it up as c# again.

Dan Weaver
  • 101
  • 1
  • 2
0

I solved the issue by re-installing the OS. But I do remember that i was installing lot of software while i was installing the Visual Studio that. might have corrupted the OS file

Madan
  • 254
  • 2
  • 9