0

as the name implies, I've been having issues trying to run tests using the nunit3-console.exe command with some tests because it is apparently unable to load certain dlls:

nunit3-console.exe C:\MyProject.csproj

    1) SetUp Error : MyTest
System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Le fichier spécifié est introuvable.
   at MyProject.MyTest.StartTest()

The test itself does work and can be ran using the "dotnet test" command or the test explorer in visual studio.

Thanks a lot for the help

Nougat
  • 37
  • 5
  • 1
    Since that's not an assembly used by the console runner, it must be one required by your test. You should provide more specific info about the test assembly and what it references as well as versioning info for NUnit. – Charlie Sep 06 '22 at 15:51
  • Yes, it is indeed required by the Unit test itself, not NUnit, sorry. How would I go about supplying said DLL when using the console, considering it is the only place where I'm getting this issue? Thanks for your help! – Nougat Sep 07 '22 at 07:22
  • 1
    Normally, assemblies are referenced by installing some package, which includes them. Sometimes they are referenced directly. Sometimes they are loaded dynamically by your code. Please update the question to indicate how you acuire a reference to the assembly so we can understand why it doesn't work under the console runner. – Charlie Sep 08 '22 at 12:38
  • I think the issue here is that my project needed .NETCore dlls and I was using the non .NETCore ConsoleRunner. However, after installing the ConsoleRunner.NetCore package (3.15.2), I realize that it only seems to support Net 6.0, is there a way to get a version that supports Net 5.0? – Nougat Sep 08 '22 at 14:04
  • That's not the issue, assuming you also have the .NET Framework installed. The main console runner package runs under .NET Framewrork but launches processes under .NET Core to run .NET Core tests. If you don't update your question with new info when somebody requests it, you will not get useful answers. Please read the info that has been requested and supply it in the question (not in a comment becasue comments often get removed). – Charlie Sep 09 '22 at 15:05

0 Answers0