I want to setup the TFS to build both Debug and Release versions of my solutions but only run the unit tests when in Debug mode. I've tried disabling the builds for the test projects in my solutions' Configuration Properties, but to no avail. And what's annoying is that the tests will always fail in Release mode because it can't seem to find the files even though they exist...
So anyone know how to get TFS to run the unit tests only in Debug mode (but still build both Debug and Release modes)?
In VS2010:
Team Explorer
→ Project
→ Builds
→ In your " Build Definition " select Edit Build Definition
→ Process
Here you should configure:
I've finally found out how to do it. In the TFS build definition file (.proj), under the section for listing out the test list/DLLs, just add a $(Configuration) condition to each item as follows:-
<ItemGroup>
<MetaDataFile Condition="'$(Configuration)'=='Debug'" Include="$(BuildProjectFolderPath)/SubFolders/MyTestListFile.vsmdi">
<TestList>My Test List Name</TestList>
</MetaDataFile>
<TestContainer Condition="'$(Configuration)'=='Debug'" Include="$(OutDir)\MyTests.dll" />
</ItemGroup>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.