I am using MS unit testing framework
for testing my C# library. I have to open a file which I\'m deploying using DeploymentItem attribute
. But it i
I had a set of tests where the copy was working for some tests but not the latest, even though the DeploymentItem attribute was set exactly the same way. After exhausting everything else, I did a "Clean solution" on the solution and reran and it started copying correctly. YMMV
I have found two possible solutions in this thread:
Hope this helps.
For future references, from what I have noticed using VS 2015 - the path you specify in the deployment item attribute must be relative to the build output (debug folder). If your folder structure is "UnitTesting\TestData\Test.xml" the DeploymentItem must be DeploymentItem("..\..\TestData\Test.xml") In this case, the TestData folder need not be included in the UnitTesting project.