0

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 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. The reboot was the key. Tried nunit-console4 previously, but didn't remove MONO_PATH and then reboot before hand.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.