Top "Idisposable" questions

IDisposable is an interface within the Microsoft .NET Framework's Base Class Library (BCL).

How to dispose objects having asynchronous methods called?

I have this object PreloadClient which implements IDisposable, I want to dispose it, but after the asynchronous methods finish their …

c# .net asynchronous dispose idisposable
Why disposing StreamReader makes a stream unreadable?

I need to read a stream two times, from start to end. But the following code throws an ObjectDisposedException: Cannot …

c# stream idisposable streamreader
Should HttpClient instances created by HttpClientFactory be disposed?

So, I've registered a named client with the services collection in my Startup.cs: services.AddHttpClient(someServiceName, client => client.…

.net-core dotnet-httpclient idisposable asp.net-core-2.1 httpclientfactory
How do I correctly manage the disposing of a DataContext?

I have a web service that is quite heavy on database access. It works fine in test, but as soon …

c# linq-to-sql datacontext dispose idisposable
Is there a list of common object that implement IDisposable for the using statement?

I was wondering if there was some sort of cheat sheet for which objects go well with the using statement... …

c# asp.net dispose idisposable using-statement
Do I need to call Dispose() on managed objects?

I can't believe I'm still confused about this but, any way, lets finally nail it: I have a class that …

.net idisposable