Roman Ratskey
Roman Ratskey

Reputation: 5269

Mono System.TypeLoadException

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:

Note: This only happens on Linux Ubuntu, while working fine on windows.

Upvotes: 1

Views: 676

Answers (1)

shturm
shturm

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

Related Questions