Pergunta

I've been receiving this exception when trying to run mspec specification tests with TD.NET.

------ Test started: Assembly: DesignRightWeb.Specs.dll ------

Error: Runner failure: System.Runtime.Serialization.SerializationException: Type is not         resolved for member 'Machine.Specifications.Runner.RunOptions,Machine.Specifications,     Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
   at     Machine.Specifications.Runner.Impl.AppDomainRunner.CreateRunnerAndUnloadAppDomain(String     runMethod, AppDomain appDomain, Assembly assembly, Object[] args) in d:\BuildAgent-    01\work\340c36596c29db8\Source\Machine.Specifications\Runner\Impl\AppDomainRunner.cs:line     81
Test 'T:DesignRightWeb.Specs.given_a_string_calculator' failed: Type is not resolved     for member 'Machine.Specifications.Runner.RunOptions,Machine.Specifications,     Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'.
    System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Machine.Specifications.Runner.RunOptions,Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'.
    at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
    at Machine.Specifications.Runner.Impl.AppDomainRunner.CreateRunnerAndUnloadAppDomain(String runMethod, AppDomain appDomain, Assembly assembly, Object[] args)
    at Machine.Specifications.Runner.Impl.AppDomainRunner.RunMember(Assembly assembly, MemberInfo member)
    at Machine.Specifications.TDNetRunner.SpecificationRunner.RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
    at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)
    at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

0 passed, 1 failed, 0 skipped, took 1.12 seconds (MSpec).

I've tried installing MSpec straight from Github and also installed it using NuGet. After that - while receiving this same exception - I uninstalled TD.NET and re-installed TD.NET. Still receiving this exception.

Any ideas? Thoughts? Solutions?

Foi útil?

Solução

Could be you need to register the MSpec test runner into TestDriven.NET? Check out this post to help you:

http://eduncan911.com/blog/registering-mspec-runners-for-testdriven-net-on-windows-x64.aspx

Outras dicas

If you registered the TD.Net runner before, please unregister it (some Registry hacking might be needed - see InstallTDNetRunner.bat how to undo).

Please make sure you run TD.Net >= 2.24. Add the NuGet package to your project and run tests through TD.Net. The NuGet package also contains an updated ReSharper runner that you might want to install.

If the error still persists, you very likely have an old version of MSpec referenced somewhere. The old version is 0.3.0.0 whereas NuGet is currently at 0.4.7.0.

(I might add - by the time you posted your question we had a NuGet package contributed by someone. That package didn't contain the appropriate TD.Net runner. The issue you described should be resolved now that we have a new NuGet package containing all runners.)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top