question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.ObjectDisposedException on a WPF Application (.NET 6)

See original GitHub issue

Hi

I have upgraded my Application to .NET 6, but when I try to connect a non-existing host i run in this exception ObjectDisposedException

ObjectDisposedException

My test code

private void Button_Click(object sender, RoutedEventArgs e)
{
    try
    {
        var client = new SimpleTcpClient("192.168.0.50", 1234);
        client.Connect();
    }
    catch (Exception exception)
    {

    }
}

The cause of the error must be somewhere here, but the error only occurs with the current .NET 6 version

https://github.com/jchristn/SuperSimpleTcp/blob/c17dccec8a4e82d5a5f1d5317a864a241051f28b/SimpleTcp/SimpleTcpClient.cs#L330-L333

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tinohagercommented, Jan 19, 2022

now it works

1reaction
jchristncommented, Jan 19, 2022

Hi, yes, I just removed that in v2.5.0.2 😃 could you try it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

C#/WPF app throwing a ObjectDisposedException; why am ...
The error report indicates that it's a System.ObjectDisposedException which indicates that somewhere a method's being called on a disposed ...
Read more >
ObjectDisposedException Class (System)
An ObjectDisposedException is thrown when you try to access a member of an object that implements the IDisposable interface or IAsyncDisposable interface, and ......
Read more >
Resolving disposed ServiceProvider throws exception - .NET
NET 6, an ObjectDisposedException is thrown when a service is resolved after the service provider has been disposed, and there's no deadlock ...
Read more >
ObjectDisposedException when using Winforms ...
Hi, I am using DashboardDesigner in my WPF application by using a WindowsFormsHost control. I add a DashboardDatasource (MySql) to the ...
Read more >
ObjectDisposedException in .NET Core middleware with ...
I seem to either get System.InvalidOperationException: An attempt was made to use the context while it is being configured. or System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found