Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2012 Debugger hangs when I try to quick watch variables

I've come across an extremly annoying bug this afternoon. I've been working casually on console application I'm working on for a while now and for no reason at all the VS2012 debugger started hanging when I quickwatch any variables. It hangs for like 15-20 seconds, then I get the message

Function evaluation is disabled because a previous function evaluation timed out

If i then hit F10, the debugger unattach and the process goes on. It crashes on almost every variables that are implicitly declared

Here's the steps I have taken so far to resolve this problem.

Steps I have taken:

  • Restart VS
  • Reboot computer
  • Deleted all breakpoints
  • Deleted ncb and suo file
  • Symbol Server is not enabled
  • No Network location is used, User files are local, project files are local.
  • Just My Code enabled/disabled
  • Ensured Enable .NET Framework source stepping is NOT enabled
  • Ensured Step over properties is enabled
  • Ensured Enable source server support is not enabled
  • Start visual studio with /SafeMode to suppress extensions
  • Cleared Watch Window (was empty anyway)
  • Tried changing target platform to x64 and any CPU
  • Disabling antivius
  • Resetting visual studio default settings(devenv.exe /ResetSettings)
  • Reinstall VS

The application I'm debugging :

  • Type : C# Console application
  • Target Framework: 3.5
  • Platform target: x86

For my health sake, please help.

EDIT : I have Visual Studio Update 3, version 11.0.60610.01

EDIT: My computer specs

  • Windows 7 Ultimate 64 bits
  • Dell Optiplex 960
  • Intel Core i5-2400 3.1 Ghz
  • 4 GB RAM

EDIT : I tested on two machines (same code) without visual studio update 3 one that does work, one that does not.

EDIT: A created a simplified console application with the same settings that contains only the following lines of code. I'm getting the hang problem when I watch and then it unattach also. What could be wrong with my machine?

This is a simplified application that hangs the debugger

static void Main(string[] args)
 {
   var _AppLocation = System.Reflection.Assembly.GetEntryAssembly().Location;
    _AppLocation = _AppLocation.Substring(0, (_AppLocation.Length -
     (System.Reflection.Assembly.GetEntryAssembly().GetName().Name.Length + 5)));

   var directoryInfo = new DirectoryInfo(_AppLocation);
   Console.ReadyKey(); //I break here, check the directoryinfo
 }

EDIT 10/3/13: This is still unresolved, reinstalling everything(office,framework,vs) completly did not solve the problem. It must be a vs2012 bug that is os/hardware related. I will open a ticket at Microsoft and update if they find out something usefull.

EDIT 10/30/13: This problem have been reproduced on two machines with different hardware configuration. I'm still in contact with microsoft to find the issue. Looks like something related to the framework/windows build/visual studio.

EDIT 11/19/13: I'm still in contact with Microsoft VS escalation team, here's the process monitor log and visual studio crash dump of the problem. http://sdrv.ms/1egpX4O


1 Answers

Solution found in parallelle with the Microsoft VS Escalation team. After analysing the crash dump and process monitor it seems that VS 2012 debugger process checks the store certificate for the Microsoft Root Authority certificate.

Since both computers where in a protected no internet environment, both of them never had been connected online. Thus, they never downloaded the Microsoft CA. Since the CA was absent from the store, it caused the debugger to hang and crash for 3.5 target framework specificly.

Here's the fix from Microsoft VS Team to bypass this check when debugging: (Add in the application app.config)

<configuration>
    <runtime>
            <generatePublisherEvidence enabled="false"/>
    </runtime>
</configuration>

Problem resolved!

like image 156
Machinegon Avatar answered Sep 14 '25 01:09

Machinegon