4

I am working on selenium web driver project. I was able to built tests in Test Explorer and execute.

At once I am getting following errors when rebuilding the solution.

Unit Adapter 3.2.0.0: Test discovery starting
NUnit VS Adapter 2.0.0.0 discovering tests is started
NUnit Adapter 3.2.0.0: Test discovery starting
NUnit VS Adapter 2.0.0.0 discovering tests is started
Attempt to load assembly with unsupported test framework in  C:\..\CustomerTest.exe
NUnit VS Adapter 2.0.0.0 discovering test is finished
Attempt to load assembly with unsupported test framework in  C:\..\LoginTest.exe
NUnit VS Adapter 2.0.0.0 discovering test is finished
Exception NUnit.Engine.NUnitEngineException, Exception thrown discovering tests in C:\..\CustomerTest.exe
Cannot run tests in process - a 32 bit process is required.
NUnit Adapter 3.2.0.0: Test discovery complete
Exception NUnit.Engine.NUnitEngineException, Exception thrown discovering tests in C:\..\LoginTest.exe
Cannot run tests in process - a 32 bit process is required.
NUnit Adapter 3.2.0.0: Test discovery complete
========== Discover test finished: 0 found (0:00:02.5558095) ==========

I have changed the default processor architecture in to X64, but issue not resolved.

Please help me to resolve this issue.

Thank you.

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
ChinS
  • 199
  • 2
  • 11
  • Could you show us your Conifguration Manager window? Menu -> Build -> Configuration Manager... – tymtam Jun 08 '16 at 03:48
  • I would suggest, build your assemblies as Any CPU, for me it appears that your test host is configured to X86. – Hari Prasad Jun 08 '16 at 03:49
  • My configuration manager platform has set up to Any CPU. Sorry I am unable to add screen shot. – ChinS Jun 08 '16 at 04:07
  • Project --> CustomerTest, Configuration -> Debug, Platform -> Any CPU. – ChinS Jun 08 '16 at 04:08
  • Any one can tell me why this "Attempt to load assembly with unsupported test framework" message is giving? Is this something to do with Nunit version? – ChinS Jun 08 '16 at 04:47
  • It might be happened due to the incompatibility version of NUnit and NUnitTestAdapter. Please visit my answer: http://stackoverflow.com/questions/35056195/unsupported-test-framework-error-in-nunit/38636695#38636695 – Ripon Al Wasim Jul 28 '16 at 13:00

4 Answers4

7

I had this problem just today for some odd reason, because I didnt change anything in the meantime and it worked before.

Fixed it by: Project-> [YourProjectName].properties -> Build -> Platform target: "Any CPU" -> Untick "Prefer 32-Bit"

Tentano
  • 71
  • 2
2

It seems to be the same problem like here: Visual Studio FsUnit test setup - Exception NUnit.Engine.NUnitEngineException So installing Adapter Version 3.0.10 should solve your problem. At least it did for me.

You can follow the issue on github.

Community
  • 1
  • 1
scher
  • 1,813
  • 2
  • 18
  • 39
  • Thanks for the answer. It worked for me as well. I installed VSTestAdapter 3.0.10. Problem resolved. Thanks again. – ChinS Jun 10 '16 at 03:13
1

I faced the same problem with NUnit 3 Test Adapter (version 3.2.0). I uninstalled it and tried NUnit Test Adapter Version 2.0.0.0. That solved the problem for me.

I used the VS > Tools > Extensions and Updates to install/uninstall the adapter.

My VS project is set to build for Platform x86 and I was using VS Ultimate 2013 Update 5.

HappyTown
  • 6,036
  • 8
  • 38
  • 51
1

I had the same problem with my .NET Core 2.0 project with NUnit 3.9 in Visual Studio 2017 and was stuck with this for quite some time. None of the solutions suggested in other related questions worked.

Then I figured out from this link that a class library with target .NET Standard does not work. The test project has to target .NET Core. Also, Microsoft.NET.Test.Sdk NuGet is required.

So, the steps are

  1. Make sure that the test project targets .NET Core
  2. Install latest NUnit NuGet (I used 3.9)
  3. Install corresponding NUnitAdapter NuGet (I used NUnit3Adapter)
  4. Install Microsoft.NET.Test.Sdk NuGet

Re-build and your tests will appear in Test Explorer in Visual Studio.

Arghya C
  • 9,805
  • 2
  • 47
  • 66