Visual Studio Tips - View Uncaptured Exception

in VSTips

Ever have code where you catch an exception because to handle it, but you don’t need to use the exception itself? Maybe just knowing the exception type is enough for you. But then you sometimes want to see it while debugging?

Previously I would just capture the exception and just live with the warning about an unused variable, but now I do this.

Continue Reading

Visual Studio Tips - DebuggerDisplay

in VSTips

When you look at an object in the Watch window what you see is whatever comes out of the ToString() method. But what if you could control what was displayed so that you could see some meaningful value? Well, you can.

Continue Reading

Data Driven Layout in Server-side Blazor

in C# Blazor Razor Components

One thing I stumbled on with Blazor was how to create a layout that changed based on the data on the page. For example, you may want to include bread crumbs in the header of your page. You could get the URL and try to parse out where in the application from your MainLayout, and then figure out what you need to figure out to create your breadcrumbs. But ideally you’d have each page figure out it’s own breadcrumbs and pass that data to the header.

Continue Reading