I am using RC.
I have configured TeamBuild to run unit tests defined in a test run configuration. All the build steps work correctly except when TeamBuild tries to copy the "additional files and directories" specified in the test run configuration it runs into a UnauthorizedAccessException.
When I run the unit tests locally all the additional files and directories are correctly copied to the /TestResults/<test run name>/Out directory.
When I try to execute the build on the build server, the log file shows that TeamBuild is trying to copy the files on top of themselves. Isn't TeamBuild supposed to copy all the required files to a dedicated test run directory in the same way that a dedicated run directory is used when you run your unit tests locally (see above)
Excerpt from TeamBuild log file (I have substituted the project name, build type and file name):
C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets : warning : Warning: Test Run deployment issue: Failed to copy file 'c:\builds\<project name>\<build type>\sources\main\foo.xml' to 'c:\builds\<project name>\<build type>\sources\main\foo.xml': System.UnauthorizedAccessException: Access to the path 'c:\builds\<project name>\<build type>\sources\main\foo.xml' is denied.

TeamBuild throws errors when deploying "additional files and directories" for unit tests
sumesh_tewatia
By the way, it appears that where I have explicitly specified files to be copied an error is NOT thrown. There is only an error on the copy folder operation. Here is an excerpt from the .testrunconfig file:
<deploymentItems type="Microsoft.VisualStudio.TestTools.Common.DeploymentItemCollection">
<m_container type="System.Collections.Hashtable">
<key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
<path type="System.String">Company.ProjectConnect.Connector.Test\TestFiles\</path>
<outputDirectory type="System.String"/>
</key>
<value/>
<key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
<path type="System.String">hosttest.app.config</path>
<outputDirectory type="System.String"/>
</key>
<value/>
<key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
<path type="System.String">hosttestSettings.xml</path>
<outputDirectory type="System.String"/>
</key>
<value/>
<key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
<path type="System.String">ProjectConnect.EntLib.config</path>
<outputDirectory type="System.String"/>
</key>
<value/>
<key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
<path type="System.String">Company.Project.Test\Test Files\</path>
<outputDirectory type="System.String"/>
</key>
<value/>
</m_container>
</deploymentItems>
Thomas LEBRUN
Ivan Ooi
BurnChrome
Andrew, thanks for reporting this. This happened to be a known issue with a simple workaround. Can you remove the trailing slashes from the deployed folder names in runcofig file and try
Looking at the excerpt that you sent, you will need to replace 'Company.ProjectConnect.Connector.Test\TestFiles\' with 'Company.ProjectConnect.Connector.Test\TestFiles' and 'Company.Project.Test\Test Files\' with 'Company.Project.Test\Test Files'.
Please let us know if this does not solve your problem.
Thanks.
Levyuk
That did the trick.
Thanks.
andyboy