简体   繁体   中英

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

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!

Consider using Process Monitor tool to get a log of file, network, registry and processes operations happen during your investigation. After capturing the log, you may see through it and investigate the possible reason. Or, you can send your log to me and I will investigate it on my side

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

I have done a quick research on msdn and found this : http://social.msdn.microsoft.com/Forums/vstudio/en-US/2055d3a0-56d9-4134-be23-09a91203e508/quickwatch-says-the-following-for-all-evaluations-function-evaluation-disabled-because-a-previous

Please try the following suggestions to check the result:

Click Tools | Options.. | Debugging | General, and uncheck "Enable property evaluation and other implicit function calls" option. Step into (F11) the code to find the root cause of the "time out" Restart debugging

For more information on the Function Evaluation error, please refer to: http://msdn.microsoft.com/en-us/library/ms234762(VS.80).aspx

Also, we could get more workarounds of Function Evaluation at blog: http://blogs.msdn.com/greggm/archive/2005/11/18/494648.aspx

Also it may sound weird but have you the latest update of visual studio 2012?

I had some similar issues when running VS2012 with UAC(User Account Control) turned on, and when having installed some extensions, VisualStudio binds to the running w3p.exe process which works as expected under 1 worker process. Upon allowing multiple worker processes to exist studio cannot track all the independent threads and chokes on the data which reads as corrupted memory.

For myself I have the save setup has yours except for the x64 bit. This always gave me headache in programming... Visual Stutio is 32 bit as long as i know and there is surely a reason why... Anyway you sample work and no hang happend... I cannot tell you exactly why it happened but i'm sure it's a 64 bits related environment of development.

I tried provided code.

VS2012 Ultimate works fine on debug settings and on release setting.

I tested on two differents PCs (desktop and surface Pro)

I also forced x86 setting instead of AnyCPU.

Here is my output for the test application :

http://beehiver.jurion.me/debug%20working.png

I recomend complete uninstall all VS and ALL versions of .net and reinstall. It seems to be a problem on your laptop.

I had the same problem. I suppose its more to do with the hardware configuration. I recently upgraded from 4GB ram to 8GB with Vs 2012 and have never been able to replicate the problem. I used to consistently get this error with the earlier Hardware config.

当您的代码等待某些先前的线程完成执行时,也会尝试删除.suo文件然后重新启动visual studio

This may be related Console.ReadKey() problems/bugs. http://blogs.microsoft.co.il/blogs/dorony/archive/2012/09/12/console-readkey-net-4-5-changes-may-deadlock-your-system.aspx Does the problems persist if you use a different method of "pausing?"

There are also some disadvantages of VS. For example, if you open two VS at the same time, while you are writing code, it sometimes get into no response and showing "Saving auto recovery Infomation"

I had this same problem with Visual Studio 2015 (including Update 1 and Update 2). So posting my solution (which I submitted to MS) in case somebody else has this problem.

Whenever I tried to use QuickWatch in Visual Studio 2015 Enterprise it would hang the development environment. I can't click on anything and I'm forced to kill the process via Task Manager. It seems like the modal window opens behind it.

My computer is an HP Spectre and I have another monitor plugged in. I've tried it on both monitors.

The fix was to:

  1. Switch to a single monitor
  2. Make the QuickWatch open (which it does)
  3. Move it around (which must save the window position)
  4. Close it
  5. Plug second monitor in
  6. Now when I use the QuickWatch, it will open correctly

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM