VS 2012 Debugger hangs when I try to quick watch variables
Asked Answered
N

11

25

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

Noctiluca answered 18/9, 2013 at 19:7 Comment(20)
This happens for me when using the Watch window, or hovering a variable. It was a problem in VS 2010 also.Lactation
What are the specs of your system? My work computer does this and the PC is outdated. My home computer doesn't and it is quite new. I have had it happen at work and then not at home on the same solution files.Revisionism
@Dan King - See edits above, it's not that new but should be able to debug a C# console application.Noctiluca
make sure you build full debug information, and try to disable "just my code"Return
@Return - How can you make sure you "build full debug information" my project target build is debug and I've cleaned and rebuilt my solution. For the just my code option, does not work same problem.Noctiluca
Go to build -> advanced -> pick for your configuration "Full debug information".Return
@Return - Yes, Debug Info is at FullNoctiluca
I am wondering if there is a recursive call somewhere near that piece of code? If there is, and it fails to evaluate in debug, you may get this. Otherwise, not sure what else to sayReturn
@Return No there's not, it's a really simple piece of code, and it does not matter where I put that breakpoint. If I check the args in Main(string[] args) I'm getting the same error. I will try to see if there's an update to vs I could do.Noctiluca
Which windows version and is it 32/64bit os?Chassepot
@Chassepot Windows 7 64 bits, I've edited the post to include that.Noctiluca
Did you try to reinstall Visual Studio?Araliaceous
Can you show us the arguments that you gave used? Did you set them in the Properties/Debug?Desirable
You can try using the class "Int32" instead of int. also hover over the int and check if the namespace is in fact "int" the primitive .Sauveur
@AmirOfir I did set some arguments in the Properities/Debug, see my editNoctiluca
@Araliaceous Yes, did not work. This problem is just mindblowing.Noctiluca
Are you running VS with an admin user account?, sometimes strange things happens when a non-admin user is used to launch VSRobet
@FelipeP Yes, running as admin.Noctiluca
Not sure whether this has been suggested yet but if you take a complete dump of the hanging process, you could try to debug it by using windbg.Twotime
Might want to run a Memory Check, you may have a stick of RAM that is dying and not allowing your program to perform correctly?Iglesias
N
5

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!

Noctiluca answered 18/9, 2013 at 19:7 Comment(1)
ridiculous but true, it solved my problem - thank you so much!Plenish
S
2

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
Shewchuk answered 18/9, 2013 at 19:7 Comment(1)
my second screen got disconnected by mistake, after I reconnected it the problem happened... your answer is very correct, just had to remove HDMI connector, was not enough to turn off second monitor! and the quick watch reappeared on the whole screen. resized it, reconnected HDMI, rearranged my windows and all is back now.Immature
W
1

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

Wildwood answered 18/9, 2013 at 19:7 Comment(0)
C
0

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"

Crawly answered 18/9, 2013 at 19:7 Comment(0)
V
0

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?

Vereen answered 24/9, 2013 at 20:27 Comment(2)
Yes I do have the latest update. This solution does prevent the debugger from hanging but If the option is turned on I cant watch any members of about any classes. This is just no a viable solution.Noctiluca
This is weird, maybe you should ask microsoft directly, even if you will probably receive useless answer. There is probably something that hasn't been deleted/fix (when repair/uninstall vs) that could make your debugger going wrong. Have you try in compatibility mode Win Vista or XP? I would also try to change the framework target (Is it possible to have a corrupted framework?)Vereen
S
0

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.

Smoothtongued answered 25/9, 2013 at 21:0 Comment(1)
I always turn off user account control on every windows installation. This feature is just annoying and useless. So that's no it =(Noctiluca
T
0

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.

Twentyfourmo answered 10/10, 2013 at 14:37 Comment(0)
S
0

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.

Secrest answered 18/10, 2013 at 6:22 Comment(0)
F
0

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.

Festination answered 29/10, 2013 at 20:17 Comment(1)
This in interesting, both machines where I can reproduce the problem have only 4 gb of ram.Noctiluca
A
0

This Problem happens when your code is waiting for some previous threads to finish there execution,also try to delete .suo file then restart visual studio

Animal answered 30/10, 2013 at 9:43 Comment(0)
B
0

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?"

Bodoni answered 30/10, 2013 at 19:50 Comment(2)
For reference this can be achieved by simple Console.ReadLine().Iglesias
This is not it, I can reproduce the problem with the sample above in a windows form project with a button and on various code samples were implict variables are declared.Noctiluca

© 2022 - 2024 — McMap. All rights reserved.