0

I've recently been trying to implement automated unit test within my Jenkins pipeline using the nunit3-console.exe, for multiple Test projects that implement Microsoft and Asp.Net related functionnalities within their set-up methods.
The test projects are in Net 5.0 and trying to run them will give me this error:

    1) SetUp Error : MyProjectPath
System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The specified file could not be found.
   at MyProjectTest.StartTest()

This is obviously not the only missing assembly, as it requires many of the Microsoft.Extensions and Asp.Net related dll to functions. Manually supplying said DLLs to the Test folder directory does allow the command to properly run, but this is obviously not a great solution in the long run. Supplying the missing assemblies to the GAC would also fix the problem, but only as long as we don't update any of our packages.

What would be the intended workflow when a Test requires such DLLs? Where should they be placed so that they can easily be maintained and/or replaced after updates? I've tried using the .Net Core console runner hoping it might include these DLLs as well.

Thanks a lot for your help!

Nougat
  • 37
  • 5

1 Answers1

0

https://github.com/nunit/nunit-console/releases

Use the NUnit.ConsoleRunner.NetCore.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • I've tried using the latest version of the NUnit.ConsoleRunner.NetCore 3.15.2 as well as 3.14, and the first didn't fix the issue, while the second couldn't be installed under a Net 5.0 project – Nougat Sep 09 '22 at 09:53