如何在TFS2010构建定义中为"测试程序集文件规范"对话框指定正确的搜索掩码?

Lud*_*dwo 9 continuous-integration mstest tfsbuild tfs2010

我不知道如何指定正确的掩码来在TFS2010构建定义中搜索我的测试程序集.我没有使用默认的Binaries文件夹作为输出程序集.每个测试项目都有自己的bin\Debug或bin\Release输出文件夹.如果我使用默认掩码**\*test*.dll我的测试失败并出现此错误:

API restriction: The assembly 'file:///E:\Builds\....\obj\Debug\xxx.IntegrationTests.dll' 
has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
Run Code Online (Sandbox Code Playgroud)

这是因为**\*test*.dll掩码将在bin\Debug和obj\Debug文件夹中找到同一程序集的多个结果.

我试图更改此掩码以排除obj\Debug文件夹并仅使用bin:

**\bin\Debug\*test*.dll
**\bin\**\*test*.dll
**\Debug\*test*.dll
Run Code Online (Sandbox Code Playgroud)

但FindMatchingFiles活动总是返回0结果.

它只在我通过测试程序集的完整路径时才有效.

如果我想从测试程序集搜索中排除obj\Debug文件夹,那么正确的掩码是什么?

解决方法:
我仍在使用FindMatchingFiles活动,但我必须使用以下参数添加Assign活动:

To - testAssemblies
From - testAssemblies.Where(Function(o) Not o.Contains("\obj\")).ToList()
Run Code Online (Sandbox Code Playgroud)

我正在以这种方式过滤"obj"文件夹中找到的所有测试程序集.

Lud*_*dwo 1

我仍在使用 FindMatchingFiles 活动,但我必须使用以下参数添加分配活动:

To - testAssemblies From - testAssemblies.Where(Function(o) Not o.Contains("\obj\")).ToList() 我正在以这种方式过滤“obj”文件夹中找到的所有测试程序集。