Debugging Tips and Tricks with Visual Studio by Joseph Guadagno
9K views
Nov 6, 2023
Architecting an application can be challenging. What do you do to keep your application flexible to ever-constant requirement changes? How do you handle landscape changes (cloud, on-premises, databases)? How do you avoid over-engineering the application? How do I make sure my application plays well with other applications? In this session we’ll take a look at some well-understood and practiced Software Architecture patterns. We’ll cover these patterns at a high level to understand how to use these patterns in different scenarios. You’ll walk away with some knowledge, tips, and tricks that you’ll be able to use for new and existing applications.
View Video Transcript
0:00
This session I love doing because I can do it for 20 minutes or I can do it for 20 hours
0:06
We're going to kind of, I'm going to give you some tips and tricks that I've learned
0:10
and develop developing over the last 20 days or 20 years, depending on how you look at it
0:18
We're going to go through a simple application. It has, we have a person class that has first name, middle initial, last name, email address
0:27
data for children. And then there's this method that will convert the first name, last name
0:37
middle initial into a full name field. So I'm going to go through and debug some of the known
0:46
bugs in this application. So if we look at it, this is using the new C sharp nine syntax. So we
0:54
don't have the sub main, even though it's visible. And we'll see that in a minute. So we're going to
1:02
print out Hello World, and then kind of load a list of people and then navigate. But before we do that
1:09
I want to do one thing. I'm going to build the application. And I'm going to try my hardest to
1:15
tell you every keyboard shortcut I use, but it's very different from person to person, machine to
1:25
machine, because with Visual Studio, you can customize your keyboard shortcuts. So the reason
1:30
why I built this screen is to show you one thing. Oops, that's not what I want to do. Let's rebuild it
1:38
So before we go into, let's go and do that
1:54
I'm going to make sure the product's on .NET 6. Oh, great
2:05
Let's go and make sure this is on .NET 6. So I am going to edit the project file and change it to .NET 6
2:19
And then rebuild it. There it goes. That worked. And now I'm going to kind of go through and walk a little bit about what that means
2:29
So I'm going to open up this in File Explorer. So if you've ever gotten into File Explorer, this is after I compiled the application
2:37
you're going to notice that there are two directories in there, bin folder and obj folder
2:44
Those get added as soon as you build a product. Now, you might be thinking, well, Visual Studio does that, blah, blah, blah
2:52
Actually, Visual Studio doesn't do it. There is a product underneath the scenes called MSBuild or MicrosoftBuild that takes your source code
3:01
and generates the IL that is used by .NET to execute the program
3:08
So here you see I have my C-sharp project file, the mastering debugging
3:15
and then the two class files. If I go into the bin directory, you'll see I have two directories here
3:22
one called debug and one called release. These are called debug configurations
3:29
So you'll notice up in here, I have a DBU because I have the fonts increased for the presentation
3:37
You can't see the full thing. If I click on here, you'll see I have a debug and release configuration
3:44
And what that does is those tell Visual Studio or MSDebug how I want to handle the actual code
3:54
So when you do a debug now with later versions, I think this started in .NET 5, it creates a separate folder for each framework you're building against
4:06
In this case, I've only had it for .NET 6 and .NET 7
4:11
So if I go into this file, I'll see a couple of files in here
4:18
The one most of us are used to are this, the mastering debugging.exe
4:25
This is the actual executable that runs. But there's also some other files that I didn't generate, but MSBuild generated for me
4:35
Mastering debugging, which is the actual code that runs. The mastering debugging is just a shell that will call out to this DLL
4:43
Then there's this hidden file called PDB or Program Debug Database. So if you've been doing any Microsoft development for a while, you've probably run across an exception or the yellow screen of death in ASP.NET, now the light blue screen of death
5:04
Basically, that tells you, hey, there's an error. The application crashed and here's a bunch of stuff
5:10
Visual Studio, or in that case, IIS, gets that from this PDB file
5:15
So inside the mastering debugging and the mastering debugging.dll, these are just the executable nodes
5:24
The PDB file ties the code that's running with the source code
5:30
You're probably saying to yourself, I don't want to distribute the source code with my app. And you don't
5:36
So that's why there's a debug and a release build. If you choose the release build and you have the right settings selected, the PDB file is not generated
5:45
But this is for you to be able to debug your app, as we'll see in a minute
5:51
So let's go and run this app. If I click this little button here, I'll get the ability to run it in debug mode
6:00
If I click this button here, I start it without debugging. The difference between the two is run generates that PDB file
6:09
And then Visual Studio, which is called the debugger in this particular case, attaches to that file
6:16
So it generates this PDB file and puts this on top of it and says, I'm going to watch what you're doing so that I can explain it here
6:24
If I click on just this button, it's just going to run the application
6:30
And we'll see here that I get an error. So there's an error
6:36
system argument out of range, exception index was out of range, must be negative, blah, blah, blah
6:42
So let's figure out how to find that problem. So I'm going to hit enter to end it
6:51
Before we go and look at the problem, let's look at what our options are. So if we go
6:55
on the debug menu, you'll see a lot of different options. So if we click on windows
7:02
There's breakpoints, exception settings, output, et cetera. Breakpoints we'll talk about in a little bit
7:08
Exception settings we'll talk about towards the end. The output you kind of see right below
7:14
This menu will also change while we're actually debugging the application. Then what I talked about before there start debugging and start without debugging So if I hit F5 on my machine I going to start debugging which is what most of us do or click the solid green triangle Some of these other items we gonna cover in a minute
7:36
So I'm just gonna put a break point here for now. So I can do that many different ways
7:42
I can click in what's called the gutter, and that's gonna turn it red and put a break point here
7:48
And the reason why I wanna do that is to start the app in debugging and show you some
7:53
the other debugging menu items. So hit play. You notice this one took a little bit longer
7:59
The console app is going to start, and now a bunch of things are happening
8:04
So to the right, I get, and this could be left, could be the bottom of your machine
8:08
I get the diagnostic tool. So this is taking a look at the memory, events that are happening, how much CPU I'm using
8:15
And then because I have the Enterprise Edition of Visual Studio, I am seeing what's called
8:22
IntelliTrace, which is a bunch of events and stuff. I'm not going to cover that. That's a whole talk
8:27
all by itself. But if you look at my Visual Studio menu, a lot of things have changed
8:34
My debugging menu went a heck of a lot longer. Now it takes up the full screen
8:41
So let's take a look at it. If I look at Windows, the Windows added a whole bunch more
8:46
So again, I'm going to talk about breakpoints exceptions a little bit later. Diagnostic tools
8:51
that's everything to the right so that appeared automatically because i always have that there
8:56
if i was running python i would see this gpu threads this is used if you have a lot of
9:04
if you're using a graphics processor you can see all the threads if using the parallel test library
9:14
these three windows will show the tests or the different threads that you're running we're going
9:20
going to focus on the watch autos local and immediate in a couple of minutes these are if
9:28
you're using xaml or html the live visual tree will show you all the different elements and how
9:34
they relate to each other for chrome or edge and these will show you for xaml call stack we'll look
9:42
at in a little bit the threads modules and intellisense events are for multi-threaded and a
9:50
The rest are if you're really hardcore developer and want to look at the memory being used
9:55
manage memory, and disassembly. So let's take a look at the others
10:00
I can hit F5 to continue the app. I can stop it by doing Shift F5
10:06
I can detach all. Remember when I said when you start debugging, Visual Studio will kind of hook onto the application
10:14
The detach will keep the application running, but Visual Studio is no longer paying attention
10:20
Attach Unity, if you're building a game or something with the Unity engine, this is what that's for
10:30
Terminate All will stop all the applications that Visual Studio is attached to
10:35
Restart will do that. Hot Reload or Hot Mess is the applied code changes, depending on the type of project you're using
10:47
So you may or may not be able to edit the code and apply it without restarting the application
10:53
We're not going to cover that because it's still a little hit or miss
10:57
These performance profiles are because I have a third-party tool in there
11:03
Attach snapshot debugger. This is a cool tool if you have your apps in Azure
11:10
You can attach the snapshot debugger to your Azure instance, whether it be a VM or an Azure ISS, IIS site
11:22
It'll look at that. So let's take a look at some of the stepovers
11:29
And we're going to kind of cover these in a minute. So I see the hello world is going
11:35
I'm going to step over that. So let's go and click this F10
11:39
So step over means run that code. I'm good. So I'm going to go to the next line here by clicking the step over
11:48
And I see, okay, this is list of person. It's going to create a variable called people using this populate people method
11:58
If I'm new to the app, I'm going to be like, well, what's that? So I'm going to do something called step into
12:03
So I'm going to go inside of that method. I click that
12:07
You see my mouse and my current line move to line 21. One thing I want to note, the colors that you see might be different
12:16
This is the color scheme I chose. I also changed the current statement to change to yellow for this presentation because it kind of accentuates the line of code we're on and makes it easy
12:31
But the default is just to kind of highlight it. So I see that's the method. I'm going to continue. Now I get this line of code that says it's going to create a new list of person and creates a person with the first name Joseph, James, Guadagno, email address, date of birth, number of children, etc
12:53
So I'm like, OK, that's good. I can then step out of the method or I can continue running
13:00
So if I choose step out, I'm going to go back out to the top and now I'm at this six
13:06
So I'm like, OK, that's good. So let me just step over that, run that method
13:11
And if I look at the person class, I'll see that there's four people
13:15
So so far, that's good. I'm going to go step over, step over, keep going
13:21
and I notice it generates a person. If I go back and look at it, it generated the first one
13:30
So we look here, we see it executed line 10. If I go again, it's going to execute that
13:39
Now, if I notice before, as you see here, it generated the second line
13:44
If I notice before, it generated four of them. And if I look at the class, I can see there's four
13:49
So let me put a breakpoint here and then I'm going to continue
13:55
So it's going to go and run all those up into that point
14:01
So if I look at the code, I'll see here it generated Joseph, Deirdre, my son Joseph and my daughter Emily
14:09
Now, if I run this code, if you notice, it only generated four people
14:14
I'm accessing the six. So this is where the bug is going to go. So I click run, I'm going to get an exception caught message
14:24
And I'll make that a little bit bigger so we can see. And it says index out of range must be negative, blah, blah, blah
14:31
And it says it was thrown in this call stack. Then I see a couple of options here
14:37
View details, copy details, start live section, and then two other things in the exception section
14:44
So let's look at view details first. view details shows us something called a quick watch quick watch allows you to see
14:53
different variables so this is going to be a grid of the availables here so right now there this special character here the American dollar sign and exception So this is going to show me a special variable
15:06
Because I'm in an exception mode, I want to see this. So basically it does a two string of everything
15:12
So the exception property has like eight or nine different properties, an actual value
15:17
a data, which is a list that I can look at and see a bunch of properties
15:22
and then an interception and a message. You also notice that there's this little view thing, which is called a visualizer
15:32
I can click on view and see it in a larger screen
15:36
which is really handy if there's a lot of text. Let's say you're returning HTML from a database or something
15:42
You want to see the whole thing. You can also change the type
15:46
So there's four built-in visualizers. There's an XML visualizer. If I'm returning XML with this variable here
15:53
it'll do the pretty printing of the XML, give you a tree that allows you to break it out
15:58
and see the different pieces of it. Same thing with HTML and JSON
16:03
So I know this error is here. I can fix it. It's already fixed in the code
16:10
Another thing to do is you can tell Visual Studio, So by default, it is going to break on the exception
16:19
Because I'm already in debugging and I turn this option off, it's not going to do it
16:25
If I click this, I can say it should always break on this exception or say never break when this exception happens because I want the code to be smart enough to handle it
16:39
There's also the exception settings, which are here. And let me zoom out of this a little bit
16:48
Exception settings allow you to go and override the exception settings. So here I can see everything that's solid means everything underneath there is going to happen
17:01
So this is going to break on any common language runtime exception
17:05
But I can turn those, or actually, no, it's solid. If it was a checkmark, it would be there
17:10
So if I choose here and say argument out of range exception, break on that
17:16
Otherwise, uncheck it and it will never break. So you can control which ones break, which ones don't break
17:25
We're going to leave that for now. Let's go take a look at some of the other things
17:31
So let's stop this app for a second. Let's say I want to break on my daughter's record
17:45
My daughter, for those of you who have kids, know girls are always trouble. It's actually boys that are trouble for a while, then girls take over the reins, but to each his own
17:55
If you look at the person class, Emily is the fourth person in the list because she just happened to be the last
18:04
Imagine if this was a database and you were going back and forth and you had a thousand records and for some reason the 999th record was the one that was broken
18:16
There's the ability to do what's called a conditional breakpoint. So I'm going to do that right now
18:22
If I click on the record, you get these kind of little two options here
18:31
One is a little settings and one is a disable. So I'm going to click on this settings
18:38
Settings brings up this dialog box that allows me to set conditions, actions, remove once hit, or only enable when the following breakpoint is hit
18:49
And I'll cover that in a minute. So let's go and choose the condition
18:54
See if I can make this a little bit bigger. No, I can't
18:59
Let's see if I can shrink this if it follows along. Yep. So here you can break on any condition
19:08
So basically it has to be true or once changed. So here I can do person.firstname
19:21
And you see I have IntelliSense here. This has to be C-sharp syntax because I'm using C-sharp
19:28
and say Emily. So this is only going to break when the person first name is Emily
19:38
If I hit close, you notice here that this is now a plus instead of a red circle
19:46
and it shows me that there's a condition. So if I go back and hit play
19:55
I'm going to hit the first break point. Let's put that to the side. Now, if I hit play again, it continued all the way and it stopped at Emily
20:07
So let's go and look to make sure that's the case. We look here, it printed out the first person, which is me
20:13
Second person, my wife and the third person, which is my son and stopped on Emily
20:18
So that's cool. That allows us to go and set conditions to there
20:25
There's a couple other things you can do with the breakpoints. I'm going to stop again for a second, come back here
20:32
Let's go back to the conditions, and I right-click to get that. There's other conditions I can add, too, like the hit count
20:41
I can say only stop when this line was called three times
20:46
So this goes to the example, like 999 examples, and it always spelled on 998
20:52
I can change this. So I can say when the hit count is three, meaning this line of code ran three times, break
21:01
There's also the filter, which is true. And this is if you want to filter out certain threads
21:08
So if you're using a multi-threaded thing, only say if the thread number is one, two, three, four, break
21:15
There's also actions you can do. So here I can choose to continue code
21:23
to write out when Emily is there, and I can just put a message to Emily
21:29
So I'm going to use the keyword function that tells me the function I made
21:32
and say Emily, her email, Emily was called. I'm going to have to put this in quotes
21:46
So now I'm going to say continue code. And now it kind of changed to a diamond because it means it's going to write out and continue
22:00
So I'm going to close that and just throw another breakpoint here so we can see that Emily was written out
22:08
So we got that first breakpoint. Now, you notice the second breakpoint skipped and we came right here
22:16
So if I go and look at my output window which I accidentally closed let go back up here to build view output I should see here program dot main string So that was the function Emily was called
22:36
So you can write out virtually anything you want. You can use variables from the methods
22:40
I can wrote out person dot first name was called if I chose to
22:46
Let's say I wanted to see more data. So I'm going to take that out, take that out
22:53
And you know what? I'm kind of tired of stopping and restarting the program
22:57
If you notice here, there is a, come on. I zoomed out too far and now my mouse won't move over
23:08
I'm kind of in a virtual screen right now, so it doesn't. Now you notice that there is an arrow
23:19
And if you look at my mouse pointer, I can drag and drop that arrow
23:22
So I'm going to drag it and drop it upwards. So I'm going to put it back on line six
23:28
That's going to say, hey, redo or go back to here and redo everything you did
23:36
Keep in mind when you're doing this, it's going to re-execute the code
23:41
So if I go, let me zoom back out again. I go back and do step over
23:48
It's going to go and repopulate the people. that's a good thing and a bad thing because if i'm doing something with a database or making a
23:56
call out to a database or saving records it's going to go and resave those records so keep that in mind
24:03
when you're doing it you can also run to a point so let's say i was back here
24:12
and i wanted to run the code right to here so there's this little green guy there
24:20
it says run execution to here. So I can click on that
24:26
and it's going to execute all the code right up into that point
24:33
So if we look at our console app, you notice I said it reruns the code
24:39
So it already went through the first four iterations of people and reran the next four again. Oops
24:47
So now I'm here. I still haven't found the bug, so maybe I'm going to go back to here
24:53
Now I can right click and choose run to here or set next statement
25:04
And then I think I figured it out, but I run to here. If I put a break point here, it's going to continue and stop there at the first person
25:15
But let's say I want to skip all that but keep that breakpoint. You have two different options
25:20
You can disable the breakpoint here, and the breakpoint is temporarily disabled
25:27
Or what I like to do, I'm going to enable the breakpoint
25:31
There is a force run to cursor, which is going to just skip that breakpoint
25:39
So if I do that, it's going to skip over those breakpoints and rewrite out all those
25:45
As you can see, Joseph, Deirdre, Joseph, and Emily were written. So that's all cool
25:54
There's also a debugging menu that you can get to, which I said we were going to talk about our breakpoints
26:01
If you look at the breakpoint windows, you can see all the breakpoints that are in my application
26:07
So I have a break point here on line three, character one, line three, character one, and then line three, character nine
26:15
So this is apparently nine spaces out. I can create a new one
26:19
If you're hardcore, you can create one. You'd have to name the function
26:23
So I'd have to do program dot CS. And then I think it's main, something like that
26:31
I'm not that good to remember where it is. You can also temporarily disable them from here, as you see now
26:40
If you look here, they're disabled on the screen. I'm going to re-enable them
26:46
There's a delete all, disable all from here. This is a cool feature
26:52
So let's say it's 4.55 p.m. on a Friday. You're about to go on vacation and your boss or leader's admin calls and says
27:03
hey Joe, I got a problem with the weekly TPS report. I need you to figure it out
27:09
And you're like, I'm out, I'm on vacation. But you've been debugging the problem for a while
27:15
You can export these great points. If I click here, I'll get prompted with the dialog box
27:20
to an XML file that then Mahesh can go and learn because Mahesh loves to work late and on the weekends
27:27
He can then import that into his Visual Studio and see all that
27:34
So that's kind of a cool feature. Another cool feature is like
27:39
let's say you have those breakpoints going and you can't reproduce it on your machine
27:45
So you have to go to your boss's administrative assistance machine, but you don't want to have to install
27:54
two gigs of Visual Studio or 17,000 floppy disk if you're old school like me
28:00
there is a way you can attach to the machine. So if you go to debug, actually you have to stop it
28:09
first. So let me stop. And then I can go to debug and then there's attach to process here
28:19
So this is kind of what happens behind the scenes. It's actually attaching the process
28:25
when I hit the play button. But here I can debug any machine
28:33
So here I'm running Microsoft Edge on this machine and StreamYard, if I was a glutton for punishment
28:39
I can connect to that instance of Microsoft Edge and try to debug the code or reverse engineer the code
28:48
But here there's a connection target and this is going to look weird
28:52
because I am running in a virtual machine If I was to click on find and allow the Windows Defender, it's not going to show me any things, but I can do, let's say, admin machine
29:10
And then I can see all the processes running on his or her machine
29:16
It would look like this. And I can say, oh, well, the RDP clip is the broken one, so let me attach that
29:23
So that's a very cool feature. You have to have a port open that's like 5 something or 443 for it to work
29:31
And it works in most scenarios. So that's cool. You notice a lot when I was talking about debugging, I mentioned a person and stuff
29:41
So let's take a look at some of the other tips you can use. So I no longer want a breakpoint there
29:46
So I'm going to remove that. We're in the person. Let's take a look at the people
29:52
So if I hover over people, let's do it again. If I hover over people, you see this little data tip thing
29:59
People, there's a view, count to four. Because this is a list, it's going to show me the count
30:07
I can click on the view, and it says I'm using the IEnumerable Visualizer
30:13
Before I showed you, there was a text visualizer, an HTML, a JSON, and an XML one
30:19
This is using the IEnumerable, which by default shows just the count
30:25
I can hover over it and see that it's a list or an I enumerable that has four elements of it
30:34
These elements are of type mastering debugging. I can go and click on any one of them and see details about it
30:43
So this has a child count of one, date of birth of 531-1971, email address, and so on
30:51
I can also go and change these right here. So I can double click on this element and change it to Joe because no one really calls me Joseph
31:01
So when I change it to Joe and hit enter, it updates there
31:07
And you'll notice the full name property also changed because the full name property is based on first name, middle initial and last name
31:15
So that change. One thing to note about that is that it doesn't change a database
31:23
This is only changing the variable in memory. So if it goes back and let's say on line 12 in my code or in line 11, I'm saving to a database
31:33
It will then go and write Joe as the first name. You can also hopefully see, I'll have to zoom in for this one
31:42
There's a little pin icon next to each variable. So I'm going to pin this
31:49
And now I'm creating what's called a data tip. So this data tip will share the text
31:58
So right now it's showing a new collection debug view, and it's just with Diagnose
32:04
So now as I navigate each person, so if I Shift 10 or F10 over it, it's going to go and change it
32:16
So now as I execute, hey, what happened? I was supposed to change it to me
32:23
Why did it change it? Oh, probably because I did it off of the people
32:28
and not the person. Let me go and fix that. Let's go and unpin you
32:35
and go here to the person full name and pin that So now as I go through and run this you notice it grayed out now
32:49
because it knows that the variable is going to change and it's no longer in scope
32:56
I click that. It goes red because it says, hey, this variable is about to change
33:01
And then it changed. So now it's red to show me it's changed
33:05
So that's cool. I also have access to these variables in something called the locals window
33:15
So the locals window will be, it tries to be smart enough and determine all the variables that in scope
33:23
So based on line 10, it says I have access to arguments
33:27
Because again, this is a sub main in C sharp 10. So there's the arguments variable as a parameter
33:34
I have access to the people. so for, and I have access to a variable called person. So I can go and do the same thing I could
33:43
in that other window and change this to JJ because everyone calls him JJ. And you notice
33:49
it changed everywhere else. So it changed here, went red, this went red because it changed. So
33:56
that's kind of cool. I could also add an item to watch. Let's say I wanted to watch what this
34:03
person's full name was. So I can right click on it and choose add to watch and it adds the full
34:09
name. It says the person's not available for some reason because it never saw it. I think that's
34:16
because there is no setter for it. So that's probably not a good property to add. Let's look
34:23
at the person and do first name and add to watch. So now I always have the first person here. So I'll
34:31
always see the first person. So if I was to drag this bad boy up here and restart it again
34:44
no, I'm hitting step into, which in a list method does a lot of weird things. You don't want to do
34:52
that. So step over, you notice I have the person full name here. That's going to change. I have the
34:57
Person, first name here. That's going to change. Now, they all changed everywhere
35:02
Went to Joseph for the first name. Full name was changed. And now I'm going to go to the next one
35:09
It's going to change. So it's kind of cool. There's also other watch windows you can add
35:17
Where are we? Debug windows. There an immediate window also which I can change The immediate window lets you execute most language calls from here
35:34
Think of it like a command line for your code. So I can do person.firstname
35:46
And it shows me the person's first name. I can do person.firstName equals b, because that's what everyone calls her
35:56
And it goes and updates it. And the same thing holds true. Actually, let's pin this this way
36:04
Update it here and update it here. So you can do just about anything. The only thing you really can't do here is lambda expressions
36:13
So I can't do like a person to person dot whatever. They don't generally work
36:24
I can do basic math, five divided by two. So that's cool
36:35
What else can you do from here? I showed all that. I'm not going to cover the memory modules
36:41
One of the other things that you may have noticed, as you hover over people, you get a count of four
36:49
When you look at a person item, you get a mastering debugging
36:53
That's kind of useless if you're debugging because now I have to click on here and see things
37:00
There's these little wrenches that you can click on which basically give you the editability
37:07
But I want to see more data. So there is a hidden feature
37:13
And I say hidden because not a lot of people know about it. Called the debugger display attributes
37:19
I'm going to stop the app for a minute. And we're going to go back to our person class
37:25
And then look at this hidden for now. So I'm going to add something called system.diagnostic.debugger display
37:35
And what this does is says, hey, anytime the debugger wants to see this class
37:42
anytime the debugger wants to display something from this class display this instead
37:51
so you get the full string interpolation to it so I can put in any property that I have access to here
38:00
so right now I'm displaying the full name and you get IntelliSense
38:04
So I can do open parentheses first name and I should have IntelliSense but it not working
38:16
Right now, I'm doing date of birth dot minute, number of children equals children dot count
38:22
So when I run myself, it should say Joseph J. Guadagno, 17th minute, and number of children
38:29
one. Save that. Because if I look here, when I'm initializing myself, it's Joseph J. Guadagno
38:37
and then the children. But if you notice here, for some reason, my wife doesn't have any kids
38:43
which I have to talk to her about because we have two of them. And my son and daughter don't have
38:51
any kids, which is right. But if I run this, this is going to cause a network because that list
38:57
is null. So let's see what happens when that happens. I'm going to put a break point
39:02
here after the first person. So let's hit run. So if I go and look at the people and click on it, now I see more information. I see Joseph J
39:20
Guadagno, 17, number of children, one, and then the number of children for my wife, son
39:26
and daughter are object reference not set to an instance of an object
39:32
So an exception was raised, but it didn't break the application. It just brought me back to it to show that
39:39
So that's kind of cool. That's a way that you can add debugging information to your code
39:46
and can be publicly available. One last thing I wanted to show
39:51
So you notice we have these pin things. I can actually add stuff to it. This is the person's full name. Or in the example that TPS report that was failing, this is the problem data
40:11
and then I can actually view all those. So where is it
40:20
There's a data tips window somewhere. Oh, here it is. I can export all the data tips
40:26
So that same thing when I was done, just like I could export breakpoints, I can export my data tips
40:32
so my hash can go and handle all that, can handle that problem for me
40:40
I don't have to worry about it. And with two minutes to spare, I am done
40:46
And we can pull up the slides for any questions and or my info
#Development Tools
#Software
#Windows & .NET