jcansdale / TestDriven.Net-Issues

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

Fails every time under VS2017 Community edition #151

Closed alfredo-chv-globant closed 5 years ago

alfredo-chv-globant commented 5 years ago

Hello, I haven't been able to download the MSI installer from testdriven.net, so I tried downloading the Visual Studio extension from this site:

https://marketplace.visualstudio.com/items?itemName=JamieCansdale.TestDrivenNet

However, I've been unable to make it work. Every time I try to run anything I get the following error message:

------ Test started: Assembly: XXX.Api.Tests.dll ------

Test 'T:XXX.Api.Tests.Controllers.AssetControllerTests' failed: Method 'get_TargetFramework' in type 'NUnit.Engine.Extensibility.ExtensionNode' from assembly 'nunit.engine, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' does not have an implementation.
    System.TypeLoadException: Method 'get_TargetFramework' in type 'NUnit.Engine.Extensibility.ExtensionNode' from assembly 'nunit.engine, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' does not have an implementation.
    at NUnit.Engine.Services.ExtensionService..ctor()
    at NUnit.Engine.TestEngine.Initialize()
    at NUnit.Engine.TestEngine.GetRunner(TestPackage package)
    at NUnitTDNet.Adapter.EngineTestRunner.run(ITestListener testListener, Assembly testAssembly, String where)
    at NUnitTDNet.Adapter.EngineTestRunner.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 0.84 seconds (NUnit 3.4.1).

this is my packages.config file contents:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="AutoFixture" version="4.2.1" targetFramework="net461" />
  <package id="AutoFixture.AutoMoq" version="4.2.1" targetFramework="net461" />
  <package id="AutoFixture.NUnit3" version="4.2.1" targetFramework="net461" />
  <package id="Microsoft.AspNet.WebApi.Client" version="4.0.20710.0" targetFramework="net461" />
  <package id="Microsoft.AspNet.WebApi.Core" version="4.0.30506.0" targetFramework="net461" />
  <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net461" />
  <package id="Moq" version="4.5.3" targetFramework="net461" />
  <package id="Newtonsoft.Json" version="4.5.6" targetFramework="net461" />
  <package id="NUnit" version="3.4.1" targetFramework="net461" />
  <package id="NUnit3TestAdapter" version="3.12.0" targetFramework="net461" />
  <package id="NUnitTDNet" version="3.4.1" targetFramework="net461" />
</packages>

Is there something else I'm missing? My tests run perfectly under VS' Test Explorer, only thing being that I really hate that gadget! ;)

jcansdale commented 5 years ago

I'm interested to know which version of nunit.framework you're using?

Could you try changing it to v3.4.1 and see if that works?

alfredo-chv-globant commented 5 years ago

Hi! As per my packages.config, I'm using NUnit 3.4.1 already. When I included the NUnitTDNet, the actual reference in my project changed to the directory containing the NUnitTDNet package, which I think also contains NUnit 3.4.1 or so says the NuGet description.

alfredo-chv-globant commented 5 years ago

Wow! I got news! I don't know why but today I clicked on "Test With > Debugger" and bingo! After a few seconds all the tests ran! Then I tried "Test With > In-Proc (VS SDK)" which did nothing:

0 passed, 0 failed, 0 skipped, took 0.54 seconds (NUnit 3.4.1).

But then I tried simply "Run Test(s)" and voila! Everything seems to work now!

I've restarted my PC a couple of times and opened/closed VS many many times, but that never seemed to change anything. I'm still scratching my head here.

alfredo-chv-globant commented 5 years ago

This is completely horrible. After a few times of everything working like a charm, I'm back at square 1. It seems like Test Explorer and TestDriven.NET are interacting in some weird ways:

alfredo-chv-globant commented 5 years ago

Gee... too bad... this used to be such a nice tool not so long ago...

jcansdale commented 4 years ago

I'm trawling through some closed issues. Did you ever discover what was going wrong here? I haven't had any similar reports. 😕