Reputation: 5269
I have created a C# Socket server and when i try to run it on Linux (have Mono Runtime installed) i get this exception every time the socket initializes
System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.IAsyncStateMachine' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Project Information:
.Net 4.5
.Console Application
.None
.Normal Visual Studio Compiler
.Note: This only happens on Linux Ubuntu
, while working fine on windows.
Upvotes: 1
Views: 676
Reputation: 867
Default references in Visual Studio and MonoDevelop/Xamarin Studio are different. mscorlib
should always be referenced, but I think compiling the project in Linux host would make it work:
$ cd /path/to/source
$ xbuild
$ mono bin/your.exe
Upvotes: 1