Questions related to debugging methods and tricks in VisualStudio
Questions tagged [visual-studio-debugging]
2287 questions
22
votes
2 answers
How do I debug .NET 4.6 framework source code in Visual Studio 2017?
Here's what I've tried:
Made a new Console App (.NET Framework) in Visual Studio 2017.
Added the following code:
static void Main(string[] args)
{
new Dictionary().TryGetValue(3, out int x); //I want to step into TryGetValue() (this is…

Jon
- 5,275
- 5
- 39
- 51
22
votes
1 answer
Adding DebuggerStepThrough attribute to class
I want to add DebuggerStepThrough attribute to all methods of my class. Is it enough to add DebuggerStepThrough to the class?

selami
- 2,478
- 1
- 21
- 25
21
votes
9 answers
Failure [INSTALL_CANCELED_BY_USER] on Xiaomi device
I bought a Xiaomi Redmi 4x yesterday and I can't debug my apps in this device.
I already enabled the Developer Options in the device, switch on to USB Debugging, install the USB Drivers and accepted the RSA debugging fingerprint pop that appears…

Rafael de Andrade
- 853
- 1
- 6
- 11
21
votes
3 answers
Property value of "base" in debugger
I'm debugging the following code:
class A
{
public virtual string X => "A";
}
class B : A
{
public bool OwnX { get; set; } = true;
public override string X
=> OwnX ? "B" : base.X; // (o)
}
class Program
{
static void…

ie.
- 5,982
- 1
- 29
- 44
21
votes
1 answer
How does Visual Studio know if the source file matches the original version?
I figured out how a .NET assembly .dll file maps to a .pdb using a GUID (blog). When I debug into an assembly and it asks for the source code, if I navigate to a file, it may tell me that the source code is different from the original. How does it…

Cameron Taggart
- 5,771
- 4
- 45
- 70
20
votes
2 answers
What does -1.#IND000 mean in the Visual Studio debug window?
In the Visual Studio 2010 watch window, I found the value of a variable became -1.#IND000. What does this mean?

shapeare
- 4,133
- 7
- 28
- 39
20
votes
3 answers
In VS2015, how do I disable Step Into for auto-implemented properties?
I've just started using Visual Studio 2015 and found that it behaves differently to VS2012/VS2013 when debugging auto-implemented properties.
Say I have a property defined in a class:
public int MyProperty { get; set; }
ie. an auto-implemented…

Steven Rands
- 5,160
- 3
- 27
- 56
20
votes
4 answers
"if debug" in JavaScript?
Is there anything in JavaScript or Visual Studio to detect if the code is used in debug-mode?
Something like "#if DEBUG" in C#, but for JavaScript?

Martin
- 1,283
- 2
- 14
- 28
20
votes
1 answer
How to skip debugging all of std namespace in Visual C++ 2013?
I want to skip debugging all of std:: namespace C++ by default, without code window changing to std:: code , authored by Microsoft as xstring . This question is similar to :
How to skip common classes in VS 2008 when stepping in? and
Auto-skip STL…

Mohamed El-Nakeep
- 6,580
- 4
- 35
- 39
20
votes
3 answers
Stop Visual Studio from breaking on exception in Tasks
I have the following code:
Task load = Task.Factory.StartNew(() => {//Some Stuff Which Throws an Exception});
try
{
load.Wait();
}
catch (AggregateException ex)
{
MessageBox.Show("Error!");
}
Whenever an exception is thrown in the Task, I…

Krimson
- 7,386
- 11
- 60
- 97
20
votes
16 answers
Can't start debugger in VS2012 RC
Configuration:
Windows 7, 64 bit
Microsoft Visual Studio Professional 2012 RC Version 11.0.50522.1
RCREL
Running VS in administrator mode
The VS solution contains a web
application, with target: .NET Framework 4.
When I press F5, the solution…

Glen Little
- 6,951
- 4
- 46
- 68
19
votes
8 answers
How to get ToString() to show up in Debug
I'd like to get ToString() to display for a class under my control in debug mode.
It'd be nice if this was the first thing to show up when you hover over a variable with the mouse. Is there an attribute for this?

sgtz
- 8,849
- 9
- 51
- 91
19
votes
2 answers
Passing environment variables to tests in Visual Studio 2019
Seems like a pretty trivial question, but to my surprise I found no mention of this on the web.
I've got an Nunit test project (that someone else wrote and I don't want to change too much), that I need to debug. These tests depend on environment…

Arnon Axelrod
- 1,444
- 2
- 13
- 21
19
votes
6 answers
How to throw an exception during debugging session in VS2010
I have a small issue.
Sometimes when I debug an application I want to simulate during the debug session an exception thrown from a method, but there is no way to do it.
I can't even drag the cursor (the yellow one that indicate the current line) to…

Clueless
- 1,190
- 2
- 14
- 30
19
votes
6 answers
Visual studio 2012 and Qt4.8.5 : How to see QString contents in debug mode.
I use visual studio 2012 and Qt4.8.5, unfortunately I can not see the QString text variable when I work in debug mode. Is someone has a tip allow it ? Qt4.8.5 plug-in doesn't exist for VS2012.
Thank a lot
Xavier

xavSIB
- 191
- 1
- 1
- 4