You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting this error each time I run more than two nunit tests in a test suit. It doesn't show up when each test is run separately.
Npgsql.NpgsqlException (0x80004005): Exception while writing to stream ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at Npgsql.NpgsqlWriteBuffer.d__26.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlWriteBuffer.cs:line 125
at Npgsql.NpgsqlWriteBuffer.d__26.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlWriteBuffer.cs:line 134
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Npgsql.NpgsqlCommand.d__84.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 875
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Npgsql.NpgsqlCommand.d__100.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1233
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1132
at Npgsql.NpgsqlCommand.ExecuteReader() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1102
I am using Npgsql version: 4.0.0 and .NET Framework 4.5.2
The text was updated successfully, but these errors were encountered:
You're going to have to post some code to show what you're doing. But the problem is probably that you're sharing connections between tests that are running concurrently, which isn't allowed. Make sure each connection is used only within each test's method (don't declare the connection on the class).
Hello,
I am getting this error each time I run more than two nunit tests in a test suit. It doesn't show up when each test is run separately.
Npgsql.NpgsqlException (0x80004005): Exception while writing to stream ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at Npgsql.NpgsqlWriteBuffer.d__26.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlWriteBuffer.cs:line 125
at Npgsql.NpgsqlWriteBuffer.d__26.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlWriteBuffer.cs:line 134
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Npgsql.NpgsqlCommand.d__84.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 875
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Npgsql.NpgsqlCommand.d__100.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1233
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1132
at Npgsql.NpgsqlCommand.ExecuteReader() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1102
I am using Npgsql version: 4.0.0 and .NET Framework 4.5.2
The text was updated successfully, but these errors were encountered: