jcansdale / TestDriven.Net-Issues

Issue tracking for TestDriven.Net
https://github.com/jcansdale/TestDriven.Net-Issues/issues
24 stars 2 forks source link

Incompatibility with recent NUnit3TestAdapter versions #153

Closed jcansdale closed 4 years ago

jcansdale commented 4 years ago

It appears NUnit3TestAdapter package has started silently copying some files into the test project's output directory. Unfortunately this overrides some assemblies that TestDriven.NET uses and causes the following error:

------ Test started: Assembly: ClassLibrary22.dll ------

=== ERROR IN TEST RUNNER: NUnit {0}.{1}.{2} ===
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Method 'get_TargetFramework' in type 'NUnit.Engine.Extensibility.ExtensionNode' from assembly 'nunit.engine, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' does not have an implementation.
   at NUnit.Engine.Services.ExtensionService..ctor()
   at NUnitTDNet.Adapter.EngineTestRunner..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at TestDriven.TestRunner.ProxyTestRunnerFactory.Create(String assemblyFile, String typeName, ApartmentState apartmentState)
   at TestDriven.TestRunner.ProxyTestRunnerFactory.Create(String assemblyFile, String typeName, ApartmentState apartmentState)
   at TestDriven.TestRunner.AppDomainTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyFile, String testPath)
   at TestDriven.TestRunner.Server.ServerTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)
=================================================
The target type doesn't contain tests from a known test framework or a 'Main' method.

Reverting to NUnit3TestAdapter v3.5.0 appears to fix the issue.

Related

jcansdale commented 4 years ago

Here is a build of TestDriven.NET with a workaround for this issue: TestDriven.NET-v5.0.18127-beta+847ff9a272.vsix.zip

If you could give it a try and let me know how you get on, that would be very much appreciated!

//cc @arikalish and @alfredo-chv-globant, @sm-g, @PeteW 👀

jcansdale commented 4 years ago

This is RTW in 5.0.18128.38628: https://marketplace.visualstudio.com/items?itemName=JamieCansdale.TestDrivenNet

alfredo-chv-globant commented 4 years ago

It works like a charm!