imgen
imgen

Reputation: 3133

VS2012 cannot copy DeploymentItem to test output folder

I have a project that is written in MSTest. I have 3 machines that has VS2012 Ultimate Update 4 installed. But with this project, on one of my 3 machines, the DeploymentItem are not copied to the output folder which in turn causes unit test failure. The other two machines are fine with the same project. I am using TFS as source control system. Can someone help me fix this issue?

Update: I have given up, this seems to be an issue of VS2012 installation itself cause the same project can run tests fine on other machines

Upvotes: 3

Views: 190

Answers (3)

imgen
imgen

Reputation: 3133

It turns out it's my own fault. I didn't set the Test settings in the "Test -> Test Settings" menu. But how could I know? VS2012 on my other machines are all configured automatically. For some reason, that particular machine didn't. So there you have it, the answer to the question. It's a simple one. But when you don't know, it's utterly hard.

Upvotes: 0

Arafat
Arafat

Reputation: 1400

This is a wired one and I encountered a similar issue most recently where the build and output to folder was successful in few machines while it was failing in others. My web project was referencing assemblies from the GAC and a folder located in the relative path inside the solution.

Machines where the output was failing, I was receiving this error in the output something like --> Can't locate or access assemblies in the path..

I resolved the issue by

  1. Removing all the assemblies that were referenced form the relative path
  2. (optional) Manually removed the debug and release folders in both bin and obj folders for all projects. (Probably a clean solution option in the build menu will work as well here, but I avoid taking risk and wanted to be sure)
  3. Added back the assemblies from the local path.
  4. Re-build the project
  5. Run the test project and everything was working fine in all machines.

Hope this helps !!!

Upvotes: 1

Louis Somers
Louis Somers

Reputation: 2984

Do you have a different test project on that machine that points to the same output folder? According to this thread, one of the projects could fail to output in that case.

It could be that you excluded the extra project on the working machines, or that the order in which the projects are built and deployed is different. Are there any other differences (like number of processor cores) between the machines?

Another cause could be differences in user rights on the different machines (depending on the destination directory you are deploying to). Try starting Visual studio on the failing machine by right-clicking on the icon and choosing run as administrator. Does that make any difference?

Since it is working on your other machines, I guess the copy to output directory properties are already true.

Upvotes: 1

Related Questions