0
votes

I have a NUnit Library project was created in Xamarin Studio. Tests in this project runs perfectly via Run Item from the IDE.

However, via the console, it fails.

Executed in Mac OSX: nunit-console Test/bin/Debug/Test.dll

Resulted in:

System.TypeLoadException : Could not load type 'System.Collections.ObjectModel.ObservableCollection`1' from assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Am I loading the wrong System.dll somewhere?

Environment variables: MONO_PATH=/Library/Frameworks/Mono.framework/Libraries/mono/4.5/

1

1 Answers

1
votes

I experienced the same problem and spent several hours in exporting variables etc. I still don't understand why the NUnit Console Runner has the conflict with .NET 4.5 when exporting the 4.5 mono framework.

Solved the problem by calling the predefined nunit-console Command of the mono framework located in:

/Library/Frameworks/Mono.framework/Commands/nunit-console4 /my/test/project/Test.dll

The console still shows CLR 4.0 running on a 4.5 project but it works.

Please note that you maybe need to reboot or logout to eliminate any interfering exported variables.