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.
Good day all I am not sure if I should report this or not, I wrote a very simple c# program, no windows forms or other weirdness, simply a threaded websocket proxy in visual studio on windows; all works happy.
Now when I export the executable to my FreeBSD box running:
Mono JIT compiler version 4.8.1 (22.214.171.124 Sun May 28 08:30:56 UTC 2017)
Which is the latest for freebsd, I get the following error:
Error: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
at System.Net.WebConnection.Read (System.Net.HttpWebRequest request, System.Byte buffer, System.Int32 offset, System.Int32 size) [0x0002e] in <65d66c5eaa6a48038257422d3c294dab>:0
at System.Net.WebSockets.ClientWebSocket+<ReceiveAsync>c__AnonStorey5.<>m__0 () [0x0017c] in <65d66c5eaa6a48038257422d3c294dab>:0
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x00012] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0
at System.Threading.Tasks.Task.Execute () [0x00016] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0
at Coinbase+<WSfeedAsync>d__1.MoveNext () [0x001fd] in <5954f9a944254d6f8f184b8a9d4c72b8>:0
It appears I am not the only one that has tripped over this problem: https://stackoverflow.com/questions/12369881/c-sharp-websocket-mac-os-x
And for a work around, I told nginx on the freebsd server to act as a 'SSL'non-ssl proxy, that is turning the wss://secure-websocket in c# into a ws:// type, which does work. I am quite new to c# so is this a bug I should be reporting, is this the right place to report it?
My apologies if it is not,
I pasted the wrong link for 'others appear to have this problem', it should have been: https://stackoverflow.com/questions/40301543/xamarin-mono-clientwebsocket-implementation-doesnt-work-for-secure-sockets my apologies.
After my WS:// workaround I run into yet another problem with System.Net.WebSockets I will not bore with the exact details, to make a short report (Will upload source code and binaries for all the different crashes so far later) System.Net.WebSockets should be classes as unusual as it stands with mono
Could you share a repro we can try to diagnose the issue?
Oh _expletive_ I utterly forgot about this one, I will have a BSD server I can spin up an example on over the next week, will post it public on gitlab
This is not a perfect example! I just scribbled it together till I am at a better work station but the following linked code will compile in both windows, FreeBSD and linux but only work in windows.
I cannot reproduce the issue using attached example and Mono 126.96.36.199 (2017-06/1afb931de69) (64-bit)
Please wait for more extensive example though as the main base for this problem is freebsd, there is no mono 5 yet
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and reopen the bug report.