Lay Gauv

Hi.

I have just started using mstest for a project that I am working on. As always with learning something new, there are many issues that I come across with. Most of them I was able to resolve after doing some research. However, there is one issue that I can't seem to fix.

My problem is that references I add to my test project are not copied over to the OUT folder created by mstest. Because of that, the test methods are failing. Within VS, however, these same test methods pass with flying colors.

I've read in this article [http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=439612&SiteID=1] that references should be added as projects. Is this why I am having this issue Is there a work around with that I only have access to the DLL so I can't add the reference as a project.

To further elaborate my issue, here's a step by step of my issue:

I have a test project called TestProject. This project has a reference to SomeDLL.dll. The TestProject builds fine and SomeDLL.dll is present in the bin/debug folder of the project. When I run mstest on the project,

>> mstest /testcontainer:TestProject.dll /resultsfile:Results.TestProject.txt

all the test methods fail. I double check the OUT folder created by mstest and realize that SomeDLL.dll is not there.

Thank you for your help.

- Lay



Re: Visual Studio Team System - Testing References issue with mstest

David Gorena Elizondo - MSFT

Hello,

Have you tried adding your dll as a deployment item in the testrunconfig file
Try this, and then specify /runconfig:<yourtestrunconfigfile> as part of your mstest command

Please let me know if this works

Thanks,
David Gorena Elizondo
[MSFT] VSTS





Re: Visual Studio Team System - Testing References issue with mstest

Lay Gauv

Yes.. that works! Thank you so much.

I have another quick question if you don't mind.

I created a testrunconfig file that reference the DLL as a deployment item just like you said. My mstest command line looks like the following:

>> mstest /testcontainer:TestProject.dll /resultsfile:Results.TestProject.txt /runconfig:TestProject.testrunconfig

I have to run the above line 3 times for 3 different test projects. The only difference between them is the testcontainer DLL used. Would it be possible to specify all 3 test projects in the testrunconfig so I can just call

>> mstest /runconfig:AllTestProjects.testrunconfig




Re: Visual Studio Team System - Testing References issue with mstest

David Gorena Elizondo - MSFT

Hello,

Yes, you can specify the /testcontainer switch more than once to load multiple test files. Your command will look something like this:

mstest /testcontainer:project1.dll /testcontainer:project2.dll /testcontainer:project3.dll /resultsfile:results.trx /runconfig:runconfig.testrunconfig

Thanks,
David Gorena Elizondo
[MSFT] VSTS





Re: Visual Studio Team System - Testing References issue with mstest

Lay Gauv

Thank you David. You've been extremely helpful.