MStest build step failing with an access denied error.

I'm trying to run MSTest using the MSTest build step.  At first I had issues getting MSTest to run period.  But I fixed those and can run MSTests from the command line using the arguments TeamCity provides in it's log.  They run fine.  But Team City still has an access denied error.  I've given the TeamCity and Build agent all access I can, they are both running under the Local System user.  That am I doing wrong?

Part from log:
[2013-06-06 08:56:03,386] out - ----------------------------------------- [ RSIGrid::RSIGrid Build #1.0.34 (buildId = 109) ] -----------------------------------------
[2013-06-06 08:56:03,387] out - Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[2013-06-06 08:56:03,387] out - in directory: C:\TeamCity\buildAgent\work\90c5240409d1db6c
[2013-06-06 08:56:03,394] err - C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[2013-06-06 08:56:04,366] out - 2013-06-06 08:56:04,351 [4700] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to start process. Access is denied. Path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE, arguments: /testcontainer:C:\TeamCity\buildAgent\work\90c5240409d1db6c\trunk\RSIGrid.Test\bin\Release\RSIGrid.Test.dll /resultsfile:C:\TeamCity\buildAgent\work\90c5240409d1db6c\Artifacts\MSTest\RSIGridTestResults.trx, at C:\TeamCity\buildAgent\work\90c5240409d1db6c
[2013-06-06 08:56:04,366] out - 2013-06-06 08:56:04,351 [4700] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to start process. Access is denied. Path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE, arguments: /testcontainer:C:\TeamCity\buildAgent\work\90c5240409d1db6c\trunk\RSIGrid.Test\bin\Release\RSIGrid.Test.dll /resultsfile:C:\TeamCity\buildAgent\work\90c5240409d1db6c\Artifacts\MSTest\RSIGridTestResults.trx, at C:\TeamCity\buildAgent\work\90c5240409d1db6c
[2013-06-06 08:56:04,366] out - System.Exception: Failed to start process. Access is denied. Path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE, arguments: /testcontainer:C:\TeamCity\buildAgent\work\90c5240409d1db6c\trunk\RSIGrid.Test\bin\Release\RSIGrid.Test.dll /resultsfile:C:\TeamCity\buildAgent\work\90c5240409d1db6c\Artifacts\MSTest\RSIGridTestResults.trx, at C:\TeamCity\buildAgent\work\90c5240409d1db6c ---> System.ComponentModel.Win32Exception: Access is denied
[2013-06-06 08:56:04,367] out - System.Exception: Failed to start process. Access is denied. Path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE, arguments: /testcontainer:C:\TeamCity\buildAgent\work\90c5240409d1db6c\trunk\RSIGrid.Test\bin\Release\RSIGrid.Test.dll /resultsfile:C:\TeamCity\buildAgent\work\90c5240409d1db6c\Artifacts\MSTest\RSIGridTestResults.trx, at C:\TeamCity\buildAgent\work\90c5240409d1db6c ---> System.ComponentModel.Win32Exception: Access is denied
[2013-06-06 08:56:04,367] out -    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
[2013-06-06 08:56:04,367] out -    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
[2013-06-06 08:56:04,367] out -    at System.Diagnostics.Process.Start()
[2013-06-06 08:56:04,367] out -    at System.Diagnostics.Process.Start()
[2013-06-06 08:56:04,367] out -    at JetBrains.TeamCity.Utils.ProcessRunnerBase.Run(ProcessStartInfo psi) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\ProcessRunnerBase.cs:line 61
[2013-06-06 08:56:04,367] out -    at JetBrains.TeamCity.Utils.ProcessRunnerBase.Run(ProcessStartInfo psi) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\ProcessRunnerBase.cs:line 61
[2013-06-06 08:56:04,367] out -    --- End of inner exception stack trace ---
[2013-06-06 08:56:04,368] out -    --- End of inner exception stack trace ---
[2013-06-06 08:56:04,368] out -    at JetBrains.TeamCity.Utils.ProcessRunnerBase.Run(ProcessStartInfo psi) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\ProcessRunnerBase.cs:line 65
[2013-06-06 08:56:04,368] out -    at JetBrains.TeamCity.Utils.ProcessRunnerBase.Run(ProcessStartInfo psi) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\ProcessRunnerBase.cs:line 65
[2013-06-06 08:56:04,368] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Execute(IRunProcess proc) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 123
[2013-06-06 08:56:04,368] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Execute(IRunProcess proc) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 123
[2013-06-06 08:56:04,368] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Run(String executable, PlatformVersion env, PlatformType platform, EnvironmentArg[] envKeys, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 58
[2013-06-06 08:56:04,368] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Run(String executable, PlatformVersion env, PlatformType platform, EnvironmentArg[] envKeys, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 58
[2013-06-06 08:56:04,368] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, EnvironmentArg[] additionalEnvironment, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 49
[2013-06-06 08:56:04,369] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, EnvironmentArg[] additionalEnvironment, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 49
[2013-06-06 08:56:04,369] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 41
[2013-06-06 08:56:04,369] out -    at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\ProcessRun.cs:line 41
[2013-06-06 08:56:04,369] out -    at JetBrains.TeamCity.Utils.Runtime.RunInRuntime.ForkInRuntime(PlatformVersion version, PlatformType type, String executable, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\RunInRuntime.cs:line 50
[2013-06-06 08:56:04,369] out -    at JetBrains.TeamCity.Utils.Runtime.RunInRuntime.ForkInRuntime(PlatformVersion version, PlatformType type, String executable, String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\Utils\src\Runtime\RunInRuntime.cs:line 50
[2013-06-06 08:56:04,369] out -    at JetBrains.TeamCity.NUnitCommon.PlugableRunFactory.RunProcessAsPlugable.Run() in c:\BuildAgent\work\4fb4fc7600eac5a9\src\TestRunnerCommon\src\PlugableRunFactory.cs:line 33
[2013-06-06 08:56:04,370] out -    at JetBrains.TeamCity.NUnitCommon.PlugableRunFactory.RunProcessAsPlugable.Run() in c:\BuildAgent\work\4fb4fc7600eac5a9\src\TestRunnerCommon\src\PlugableRunFactory.cs:line 33
[2013-06-06 08:56:04,370] out -    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.ExecuteTasks(ITestRunArguments arguments, IPlugableTestRunner[] plugRuns) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 133
[2013-06-06 08:56:04,371] out -    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.ExecuteTasks(ITestRunArguments arguments, IPlugableTestRunner[] plugRuns) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 133
[2013-06-06 08:56:04,371] out -    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run2(String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 111
[2013-06-06 08:56:04,371] out -    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run2(String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 111
[2013-06-06 08:56:04,371] out -    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run(String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 54
[2013-06-06 08:56:04,371] out -    at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run(String[] args) in c:\BuildAgent\work\4fb4fc7600eac5a9\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 54
[2013-06-06 08:56:04,553] out - Process exited with code -1

Please sign in to leave a comment.