I've successfully made several Visual Studio debugger visualizers, and they're working very well, except that on some objects I get a time out error when I try to deserialize the object with objectProvider.GetObject()
System.Exception: Function evaluation timed out.
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
The time out happens rather quickly (maybe about a second after I click on the visualizer icon), even though some of my other visualizers work fine even with large data objects that much longer to display (5-10 seconds) and still don't timeout.
I've already made a custom object source to limit the serialization to the fields I need to display. What else can I do to get the data to deserialize without timing out?
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Debugger
I think this is not documented, but you can try changing some of the Timeouts in the above registry key, and restart Visual Studio.
I was recently hit by this in VS2012 and after googling I found this:
As the exception message says, this exception means the debugger
visualizer for the datatable is timed out. In VS debugger, each
expression evaluation windows(such as watch window, locals window,
datatips, autos window etc..) has different default max expression
evaluation timed out value. For datatip, we prefer to give a short
time out value because otherwise it will provide a poor user
expression. If you do want to use the visualizer functionality for
that datatable, you may add the expression to a watch and try to
visualize it.(Because watch window has a longer timeout value). If you
do want to get rid of this timeout in datatip, you may try to increase
the timeout value for datatip. The timeout value is a setting in
"DataTipTimeout" registry key under:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger Note:
you should probe WOW64Node for 64bit OS. You can also see other
windows' default timeout value under this key.
To Visual Studio debugger work well - "Locals" window in "WPF visualizer" (tested in WPF application), you need to find in registry:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Debugger\
DWORD parameter "LocalsTimeout" and default value (1000) set to big enough value, 5000, for example.
Related
I have an error in my form editor preventing me from modifying the form.
I know in which control this occurs but no way to find what exactly causes the problem.
I tried setting breakpoints in the InitializeComponents() of the form I try to open but it doesn't stop (I am in debug mode...). I also tried to attach using a second instant of Visual Studio as demonstrated here, but even when setting all debug exception options to "throw", the attached process doesn't stop and indicate anything about call stack nor other useful information...
All I know is that there is a disposed object I'm trying to access, but absolutely no information as to where in code, etc..
What could I possibly do to debug the situation - knowing which control is the cause but absolutely no idea as to which of the 300 lines of code causes the issue...
Has anyone else ever seen this happen? I've had Visual Studio crash over and over again when typing in an object initializer: https://msdn.microsoft.com/en-us/library/bb384062.aspx
I suspect it's some kind of Intellisense bug, since it seems to occur only when the space or period key is pressed. I'm really curious what's triggering the sudden and reproducible crash and if there's any patches or workaround to prevent it from occurring.
The image shows where the cursor is when typing within the first set of brackets. This code appears in a method, which implements an interface member for the class.
This appears to have been caused by the "HideShow Comments" extension. I'm still not sure why it occurs, but disabling the plugin stops the crash from occurring and re-enabling the extension causes the crash to occur again. This must be a problem with Visual Studio itself, since it's the only common denominator in all these extension-related crashes.
I attached a debugger and caught the following error:
An unhandled exception of type 'System.NullReferenceException'
occurred in HideShow.Implementation. Additional information: Object
reference not set to an instance of an object.
Every time I'm going through an entire file searching of occurrences of a string, VS shows a poop-up notifying me about that. I've unchecked the option to continue that behavior at number of times - to no avail.
I went to options and unchecked it there as well (see image for verification) but every time I restart VS, the settings in back there - checked and unaffected. I'm out of ideas what to try to remedy it. (Googled it. I haven't found anything that I recognized as useful.)
Those settings are saved (when you close Visual Studio) in this registry key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Find
"ShowEndOfSearch"="1"
"ShowNoFound"="1"
"ShowAllReplacementsNotAllowed"="1"
"ShowSomeReplacementsNotAllowed"="1"
"ShowNoMore"="1"
"ShowFindStart"="1"
"ShowCancel"="1"
"ShowCancelBeforeReplacementsMade"="1"
"ShowReplaceInFilesWarning"="1"
Do you have access to that key? Try setting these values to "0" in regedit.
I am making a windows phone 8 application and in the designer view in both blend and VS I get "Unable to determine application identity call" error as a dialog box.
From what I read on stack this is propably because of the Isolated Storage is getting run and the designer can't handle it.
I am wondering is there away I can get some line numbers or something where the errors are happening instead of having to manually go through the code?
By the time you see this message box it is already too late, the exception was caught and handled. You have to catch it when the exception is raised. Which is not so easy to do at design time.
One technique that's worth a shot is to use a debugger to debug Visual Studio itself. Start it again and use Tools + Attach to Process. Locate the first devenv.exe in the list of processes and select it. Set the Attach to: setting to "Managed (v4.5, v4.0)" and click OK. Let it trundle to find the PDBs (takes a while). Debug + Exceptions, tick the Thrown checkbox for CLR exceptions.
Switch back to the original instance of VS and do whatever you did before to trigger the error. The 2nd instance will break in when the exception is thrown. Which some luck you'll see your code on the Call Stack window. If the debugger doesn't break then repeat the exercise but attach to XDesProc.exe, the XAML designer. Good luck with it.
Isn't this
Unable to determine application identity of the caller?
or
Getting Unable to determine application identity of the caller Error
are the same topic????
Don't know, just asking...
Sorry for any inconvenience..
Just answered in my basic question.
I'm afraid, i don't know how to get exact string number, just keep in mind that Designer cant have an access to the IsolatedStorage and check all places where you're working with IsolatedStorage. Basically, what you need to do is to add to all constructors a lines
if (ViewModelBase.IsInDesignModeStatic)
return;
If you're working with MVVM Light, or
if (System.ComponentModel.DesignerProperties.IsInDesignTool)
return;
which is pretty the same but without MVVM Light.
Also, i edited my answer there.
Normally in Visual Studio, a watch cannot be evaluated unless the debugger is stopped at a breakpoint. Is there a trick or add-on to make Visual Studio evaluate a watch while the application is still running? For example, evaluate the watch every time execution passes a point in the code while it's still running and without changing the code to insert statements like Debug.WriteLine.
Not sure this is possible, but I thought I'd ask.
Yes, this is possible. Set a breakpoint at the location where you'd want to see the value. Right-click the breakpoint and choose "When Hit...". Tick "Print a message" and write an expression like { value }. The message is displayed in the Output window while your program runs.
I would do that using compiler directives.
#if DEBUG
Debug.WriteLine
#end if
No this is not possible to do. The evaluation feature in Visual Studio is a stack frame based mechanism. That is that every evaluation is done in the context of a given stack frame (as viewed through the stack window). When the program is running the set of stack frames is currently changing and hence it's not possible to do a stable evaluation.
Additionally there are other limitations in the CLR which prevent this from managed code. It's not possible for instance to execute a function unless the debugee process is in a very specific state.