Session

Röck Yoür Cöde: Everything That Every .NET Developer Needs to Know About Disposable Types

The show needs a strong finish—and your .NET resources need a proper exit.

A stream left open, a connection held too long, or an object disposed before its final encore can turn working code into a reliability problem. Correct cleanup starts with understanding who owns each resource and how long it needs to stay on stage.

In this practical session, David McCarter takes you backstage with .NET disposable types. Through live demonstrations and real-world lessons, you’ll explore the responsibilities of the garbage collector, what disposal actually accomplishes, and why resource ownership determines who should perform cleanup.

You’ll see how using and await using control resource lifetimes, how to implement IDisposable and IAsyncDisposable in your own types, and how shared resources and dependency injection change the decisions you need to make.

We’ll examine mistakes at both ends of the set list: resources that linger after their work is finished and resources disposed while something still needs them. Diagnostic examples will connect the code to observable behavior so you can investigate the cause.

AI joins for a guest appearance as we review generated cleanup code. We’ll check its ownership assumptions, disposal boundaries, and asynchronous behavior before accepting the implementation.

Leave with practical techniques for designing, reviewing, and troubleshooting resource lifetimes in your .NET applications.

Give every resource the stage time it needs—and a clean exit when its performance is over.

What Attendees Will Learn
• Explain the difference between garbage collection and explicit resource cleanup.
• Determine ownership and choose appropriate disposal boundaries.
• Use using and await using, and implement IDisposable and IAsyncDisposable appropriately.
• Recognize lifetime mistakes involving shared resources and dependency-injected services.
• Evaluate cleanup code, including AI-generated implementations, using targeted tests and diagnostic evidence.


Give your .NET resources a proper backstage exit! Learn when to use using and await using, how to implement IDisposable and IAsyncDisposable, and who owns cleanup for shared and dependency-injected resources. Through practical demos and an AI-assisted code review, spot lifetime mistakes before they wreck the show.

David McCarter

Microsoft MVP (Developer Technologies), Software Architect, Speaker, Trainer, Inventor, and Mentor.

Austin, Texas, United States

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top