Question

UPDATE: I've figured out that every time I run a test, a new folder is created (Benjamin_C12LPCRE 'date' 'time') but the dll is not being created where as I thought it was originally just missing.

What I have done:

  1. Removed and re-added the reference to the Main Project (DCIM) in the Test Project
  2. Removed and re-added the reference Microsoft.VisualStudio.QualityTools.UnitTestFramework
  3. Built, Re-Built and Cleaned (not necessarily in that order) the Main and Test Projects, and the Entire Solution
  4. Deleted all "obj" and "bin" folders in whole solution.
  5. Added [DeploymentItem("DCIM.dll")] attribute to the Test Project, both before the [TestClass()] and [TestMethod()] declarations

So how do I make sure all the necessary files are being created properly?

Original Question:

Yesterday, my tests were running fine, I recently did a project re-name, which led to some confusion with some of the tests, but now none of my tests are working, and they all show this error:

The test assembly 'C:\Visual Studio 2010\Projects\DCIM\TestResults\Benjamin_C12LPCRE 2014-04-29 11_57_58\Out\DCIM Test.dll' cannot be loaded. Error details: Could not find file 'C:\Visual Studio 2010\Projects\DCIM\TestResults\Benjamin_C12LPCRE 2014-04-29 11_57_58\Out\DCIM Test.dll'.

I checked the file path and lo and behold, no dll.

Should there be? Is there a way to fix this?

The Test project is in the same solution as the Main project, and as I said, I recently renamed my project which was causing some errors which I have asked about here

Was it helpful?

Solution 2

I would try two things:

  • delete all "obj" and "bin" folders in whole solution (they will be recreated on build)
  • add [DeploymentItem("DCIM.dll")] attribute in your test project, just before [TestMethod] attribute (you can also put it before [TestClass] attribute

Then rebuild everything and try again.


EDIT:

Answered by author in comments: I opened the 'output' window to see if I could follow what was happening and something strange was occurring on build. Even though I had both projects selected to build, it was skipping over the test project in the output window. So I un-ticked both projects to build, re-built the solution, then re-ticked both projects and it's working again. Very odd.

Since the solution came up in comments and it isn't mine, I mark this answer as 'community wiki'.

OTHER TIPS

I've had the same problem when there was no free space on the disk of a remote machine. Cleaning the space fixed the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top