Microsoft Unit testing error, failed to load DLL for testing

I have a .NET 3.5 class that I am trying to write for some automated tests, but when I run any tests in the solution, I get the following error:

The Test method Common.Tests.CommonTests.TestMethod1 threw an exception: System.IO.FileNotFoundException: Failed to load file or assembly 'Library.Common, Version = 0.0.1.22004, Culture = en-AU, PublicKeyToken = null' or one of its dependencies. The system cannot find the specified file. WRN: Assembly binding logging is disabled.

To enable assembly failure logging, set the registry setting to [HKLM \ Software \ Microsoft \ Fusion! EnableLog] (DWORD) value 1.

Note. There is some performance limitation associated with the assembly binding failure protocol.

To disable this feature, delete the registry value [HKLM \ Software \ Microsoft \ Fusion! EnableLog].

I'm new to unit testing, so I'm at a dead end.

I compared the links between the lib project and tests, and the only difference is that the test project refers to the MS unit test DLL.

Edit to clarify

I used the test creation wizard from my Library.Common project so that the test project referenced the Library.Common project. I also removed and built a solution, this is not a problem.

Library.Common.dll is also located in the bin \ Debug folder of my test project.

+6
unit-testing
source share
2 answers

Found a problem, I installed AssemblyCultureAttribute in the AssemblyInfo.cs file in my Library.Common project. After its removal, tests are performed.

Now to find out how to use this attribute!

+8
source share

Can you rebuild the solution? And do you link to this library.

You might want to provide more detailed information (for example, what is Library.Common).

0
source share

All Articles