Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Nunit project throwing System.IO.FileNotFoundException for dependency of referenced project

Lets say my solution has 2 projects:

  • The first (code-sharing project) called "MainProject" (A .NETStandard 2.0 project).
  • The second called "MainProjectTests" (A Nunit test project) with some unit tests for each class into "MainProject".

The first project (MainProject) has a NuGet dependency called "dependencyX". Obviously, the project "MainProjectTests" has a reference to "MainProject".

So when the test runner runs a test of "MainProjectTests" that calls methods from "MainProject" that uses "dependencyX" I'm getting a System.IO.FileNotFoundException exception:

System.IO.FileNotFoundException : Could not load file or assembly
'dependencyX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one
of its dependencies.

Why am I getting this exception? When I add "dependencyX" to "MainProjectTests" all works fine, but it seems to me not a good practice... How to solve it?

Thanks for the help.

Answers

  • flchauxflchaux FRMember ✭✭

    I've exactly the same issue with NUnit. Did you find any solution ?

Sign In or Register to comment.