Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 11910 [details]
c sharp file and dll reference to be compiled
I created a simple C# library that will login a user into Active Directory and check if user is a member of a specific group.
Running this application with mono on Linux Ubuntu 14.04 usually works fine for the first time, but after running it multiple times I receive:
System.ObjectDisposedException: The object was used after being disposed.
at System.Net.Sockets.NetworkStream.CheckDisposed () [0x00000] in <filename unknown>:0
at System.Net.Sockets.NetworkStream.Read (System.Byte buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
at System.IO.Stream.ReadByte () [0x00000] in <filename unknown>:0
at Novell.Directory.Ldap.Asn1.Asn1Identifier..ctor (System.IO.Stream in_Renamed) [0x00000] in <filename unknown>:0
at Novell.Directory.Ldap.Connection+ReaderThread.Run () [0x00000] in <filename unknown>:0
at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: Nested exception detected.
Original Exception: at System.Net.Sockets.NetworkStream.CheckDisposed () <IL 0x0001d, 0x00047>
at System.Net.Sockets.NetworkStream.Read (byte,int,int) <IL 0x00001, 0x00037>
at System.IO.Stream.ReadByte () <0x0003d>
at Novell.Directory.Ldap.Asn1.Asn1Identifier..ctor (System.IO.Stream) <IL 0x00007, 0x00023>
at Novell.Directory.Ldap.Connection/ReaderThread.Run () <IL 0x0003c, 0x0019b>
at System.Threading.Thread.StartInternal () <0x000c2>
Running this application with mono on Windows7 works as expected.
Steps to Reproduce:
1) Unpack attached compressed file, open Program.cs, search for TODO and update fields with your own information e.g. LDAP server address, username, password.
2) Compile using: csc.exe Program.cs /r:System.DirectoryServices.AccountManagement.dll
3) Run Program.exe on Ubuntu 14.04
Actual Results: Application may work as expected for the first few times, but after running for multiple times exception described above is thrown.
Expected Results: Application should not be crashing even after running for multiple times
Build Date & Platform: 07/07/2014 Windows7 x64
Additional Builds and Platforms:
Only occurs in Linux
From my understanding it looks like something in Novell.Directory.Ldap namespace is not getting properly disposed on application exit.
did you ever get any further information about this error? I currently struggle with a closed source mono-software, which give exactly this error maybe every 50th ldap-connect.
Please use https://www.nuget.org/packages/Novell.Directory.Ldap.NETStandard/ package which is the more actual version