Woundedbear
Woundedbear

Reputation: 287

Setting the deployment setting to relative path Local.Testsettings

I am wondering if there is a way to set the deployment setting under Local.TestSettings in a Visual Studio 2010 Test to a relative path. Right now we have to copy over a couple of DLL's in order to use our tests correctly. We have this path hard set on a machine, but this gets messed up if you accidentally commit that file and then someone updates.

Upvotes: 1

Views: 1638

Answers (2)

Carol He
Carol He

Reputation: 11

You can use test setting to add one deployment item. And continually use notepad to edit the *.testsettings file. Then, manually add "outputDirectory" attribute to the deployment item.

For example, there is one folder named "Config" in "myProj" which contains your online codes. And you want to copy all configuration files under the folder - "Config" to your test project - "Test.myProj" and make them also be placed under "Config" under "Test.myProj"

So you need to manually change the *.testsettings and add the following item in the file.

<Deployment>

    <DeploymentItem filename="myProj\Config\" 
    outputDirectory="Test.myProj\Config\" />
</Deployment>

P.S. VS2010 did not allow to input value to "outputDirectory". So u have to use notepad or text editor to update it.

Upvotes: 1

sircody
sircody

Reputation: 214

What is the source for these DLL's? How are they being used, as reference DLL's? If they are third party DLL's the tactic we usually do is place them into a "Reference DLL's" folder and add them as deployment items. When VS goes to execute the test it will copy them to the OUT folder along with the test DLL. Now that they're both in the same folder your tests should have no problem finding the needed reference DLL's.

If these DLL's are of your own creation (or your group/organization) I would add the project to the solution then add the reference as a Project reference. VS will automatically detect the dependency and compile the additional projects and copy the built reference DLL's to the out folder.

Upvotes: 0

Related Questions