# Passing multiple test container assemblies to the MSTest action

**URL:** https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707
**Category:** Discussion
**Created:** [February 22, 2011, 7:07am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707 "2011-02-22T07:07:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [February 22, 2011, 7:07am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707/1 "2011-02-22T07:07:19Z")

</div>

Hi,

As part of a FinalBuilder project, I have a solution iterator which I use to build all unit test projects searching by the convention that all test projects will take the form \*.Test.csproj. I then use a define fileset action to search for all output assemblies on the assumption that they will match bin\\*.Test.dll. This works well, and saves me manually tracking the test assemblies in a large solution.

However, I would also like to be able to run these test container assemblies with MSTest. Currently, I have MSTest in standalone mode running each assembly inside an iterate fileset action. This works, but leads to a separate test result file (.trx) for each test assembly.

I'd like to be able to specify the entire fileset as input to the MSTest action's ability to take multiple test containers, so that I&nbsp;get a single trx file, as I do when I&nbsp;use Run All Tests in Solution in VS2010. My attempts to do this have so far lead to the concatenated contents of the fileset to be sent as the parameter to a single run of MSTest, which causes MSTest to fail with invalid arguments.

_ **Can this be done?** _

I'm using .NET&nbsp;4.0 and FinalBuilder 7.0.0.983

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [February 23, 2011, 5:35am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707/2 "2011-02-23T05:35:53Z")

</div>

Hi   
  
 It appears that the MSTest action would not accept a CRLF delimited list of test assemblies to execute (doing so results in the Invalid Arguments error).   
  
 I have fixed this in the following build:   
 [https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_1046.exe](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1046.exe)   
  
 Once you install the new build, you can use the FileSet to Variable action to assign your test assembly list to a variable. Make sure that you set quoting to None and set the separator value to CRLF. Now you can simply pass this variable to the MSTest action as the test source.   
  
 Let me know if you have any problems with this.   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [February 24, 2011, 6:30am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707/3 "2011-02-24T06:30:20Z")

</div>

Thanks, the provided build has allowed me to pass in the fileset variable as described.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [March 30, 2011, 2:29am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707/4 "2011-03-30T02:29:06Z")

</div>

I’m running 7.0.0.993 and this still looked broken. Is there an easy workaround? Will this fix reach the production/auto update version soon? We’d like to use the built in support for MSTest, but I’m open to any solutions really (outside of a custom build - we need to easily deploy this for 300+ people).   
  
 Details: When I try the define FileSet -\> Fileset -\> Variable -\> Run MSTest it initially worked well (by using " %FileSetVar% instead of just %FileSetVar%). When I closed FB and reloaded the solution it still seemed to run, however even after all 3 steps completed the FB guy just kept on running - run, pause, stop and kill were all disabled. In short it was pretty hosed and had to closed and reopened before anything could be changed or re-run - I can send a test FB file if it would help.   
  
 Thanks,   
  
 Adam

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [March 30, 2011, 2:52am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707/5 "2011-03-30T02:52:00Z")

</div>

Hi Adam   
  
 The fix went into build 1046, and the current release build is 1065 so it is already there.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 12, 2011, 9:41am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707/6 "2011-06-12T09:41:09Z")

</div>

Can this fix be applied to v6.3?   
 I currently have build 2240, which I downloaded from the forum, to deal with another issue, but there’s no way to put a fileset in the assemblies list of the MSTest action. I don’t understand why the action does not simply accept a file set.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [June 13, 2011, 3:52am UTC](https://www.finalbuilder.com/forums/t/passing-multiple-test-container-assemblies-to-the-mstest-action/1707/7 "2011-06-13T03:52:15Z")

</div>

I have backported the fix to FB6 : [https://www.finalbuilder.com/downloads/finalbuilder/630/FB630\_2241.exe](https://www.finalbuilder.com/downloads/finalbuilder/630/FB630_2241.exe)   
  
 Not all actions support FileSets because filesets were introduced after many of the actions were written. We do periodically go through actions looking for places where we can add Fileset support (we added a bunch for FB7), I’ll put this one on the todo list for next time we look at this.
