I am developing a Rhino plugin with Xamarin Studio Community 6 for Mac. I would like to test some of my classes, thus I installed NUnit 3.5.0.
However, even with the most basic test case that does not require any of the Rhino classes, I get a System.IO.FileNotFoundException
when I use the Menu Run > Run Unit Tests.
Why does it try to load the Rhino Libraries? How can I run my tests?
My Test case:
using NUnit.Framework;
namespace MyProject
{
public class Tests
{
[Test]
public void TestArithmetic()
{
Assert.Less(1, 1 + 1);
}
}
}
The error when running the test suite:
ERROR: System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'RhinoCommon, Version=5.1.50000.0, Culture=neutral, PublicKeyToken=552281e97c755530'
Server stack trace:
at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00019] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MonoCustomAttrs.cs:128
at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00040] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MonoCustomAttrs.cs:158
at System.Reflection.Assembly.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/Assembly.cs:252
at NUnit.Engine.Services.DomainManager+TargetFrameworkAgent.GetTargetFrameworkName (System.String assemblyPath) [0x0001f] in <7934713e6a5945a48b191c3250979bc9>:0
at (wrapper remoting-invoke-with-check) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (string)
at (wrapper xdomain-dispatch) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (object,byte[]&,byte[]&,string)
Exception rethrown at [0]:
at (wrapper xdomain-invoke) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (string)
at (wrapper remoting-invoke-with-check) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (string)
at NUnit.Engine.Services.DomainManager.SetTargetFramework (System.String assemblyPath, System.AppDomainSetup setup) [0x00047] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Services.DomainManager.CreateAppDomainSetup (NUnit.Engine.TestPackage package) [0x00077] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Services.DomainManager.CreateDomain (NUnit.Engine.TestPackage package) [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.TestDomainRunner.LoadPackage () [0x0000d] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.AbstractTestRunner.Load () [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.MasterTestRunner.LoadPackage () [0x0001d] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.AbstractTestRunner.EnsurePackageIsLoaded () [0x00008] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.AbstractTestRunner.Run (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.MasterTestRunner.NUnit.Engine.ITestRunner.Run (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit3Runner.NUnitTestRunner.Run (NUnit.Engine.ITestEventListener listener, System.String[] nameFilter, System.String path, System.String suiteName, System.String[] supportAssemblies, System.String testRunnerType, System.String testRunnerAssembly) [0x000ae] in <05fea690f7d64d7ba8fba4e8fdbb8905>:0
at NUnit3Runner.NUnitTestRunner.Run (MonoDevelop.UnitTesting.NUnit.RunRequest r) [0x00075] in <05fea690f7d64d7ba8fba4e8fdbb8905>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'RhinoCommon, Version=5.1.50000.0, Culture=neutral, PublicKeyToken=552281e97c755530'
Server stack trace:
at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00019] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MonoCustomAttrs.cs:128
at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00040] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MonoCustomAttrs.cs:158
at System.Reflection.Assembly.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/Assembly.cs:252
at NUnit.Engine.Services.DomainManager+TargetFrameworkAgent.GetTargetFrameworkName (System.String assemblyPath) [0x0001f] in <7934713e6a5945a48b191c3250979bc9>:0
at (wrapper remoting-invoke-with-check) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (string)
at (wrapper xdomain-dispatch) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (object,byte[]&,byte[]&,string)
Exception rethrown at [0]:
at (wrapper xdomain-invoke) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (string)
at (wrapper remoting-invoke-with-check) NUnit.Engine.Services.DomainManager+TargetFrameworkAgent:GetTargetFrameworkName (string)
at NUnit.Engine.Services.DomainManager.SetTargetFramework (System.String assemblyPath, System.AppDomainSetup setup) [0x00047] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Services.DomainManager.CreateAppDomainSetup (NUnit.Engine.TestPackage package) [0x00077] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Services.DomainManager.CreateDomain (NUnit.Engine.TestPackage package) [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.TestDomainRunner.LoadPackage () [0x0000d] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.AbstractTestRunner.Load () [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.MasterTestRunner.LoadPackage () [0x0001d] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.AbstractTestRunner.EnsurePackageIsLoaded () [0x00008] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.AbstractTestRunner.Run (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit.Engine.Runners.MasterTestRunner.NUnit.Engine.ITestRunner.Run (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x00000] in <7934713e6a5945a48b191c3250979bc9>:0
at NUnit3Runner.NUnitTestRunner.Run (NUnit.Engine.ITestEventListener listener, System.String[] nameFilter, System.String path, System.String suiteName, System.String[] supportAssemblies, System.String testRunnerType, System.String testRunnerAssembly) [0x000ae] in <05fea690f7d64d7ba8fba4e8fdbb8905>:0
at NUnit3Runner.NUnitTestRunner.Run (MonoDevelop.UnitTesting.NUnit.RunRequest r) [0x00075] in <05fea690f7d64d7ba8fba4e8fdbb8905>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:30
In a different project that does not include any class referencing the Rhino library the test runner works for me (in Menu Run -> Run Unit Tests).
I use OSX 10.11, Rhinoceros 5.2.2, Xamarin Studio 6.1.1