Search code examples
teamcitydotcover

Using bundled version of dotCover in Teamcity resulting in "Target executable doesn't exist" error?


We're trying to setup Teamcity and are running into an issue when adding code coverage resulting in a "Target executable doesn't exist" error message.

Are build configuration currently consists of two steps; step one is of runner type Visual Studio (sln) and step two is of runner type MSTest. These run fine until we add .NET Coverage to the MSTest step. The configuration we have for the .NET Coverage is:

  • .NET Coverage tool: JetBrains dotCover Path to dotCover
  • Home: {blank}
  • Filters: +:UnitTest.Search.dll
  • Attribute Filters: {none}

We also tried adding the dotCover Home path and extra permissions to the Teamcity folder on the build server but the error remains consistent. We've added the "teamcity.agent.dotCover.log" configuration parameter which gave us this output:

08:19:31.414 |I|                               | JetBrains dotCover Console Runner 3.0.2. Build 20150303.1317.
08:19:31.453 |I|                               | LogLevel: INFO
08:19:32.178 |I|                               | 'cover' command
08:19:32.180 |I|                               | /LogFile=D:\TeamCity\buildAgent\temp\buildTmp\dotCoverLogs\dotCover-cover-57200806543828190721.log (CommandLine)
08:19:32.180 |I|                               | /Executable=D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest (Xml)
08:19:32.180 |I|                               | /Arguments=/testcontainer:D:\TeamCity\buildAgent\work\f09bf2f330c2ab9a\UnitTest.Notifications\bin\Release\UnitTest.Notifications.dll /testcontainer:D:\TeamCity\buildAgent\work\f09bf2f330c2ab9a\UnitTest.Search\bin\Release\UnitTest.Search.dll /testcontainer:D:\TeamCity\buildAgent\work\f09bf2f330c2ab9a\UnitTest.MiddleTier\bin\Release\UnitTest.MiddleTier.dll /testcontainer:D:\TeamCity\buildAgent\work\f09bf2f330c2ab9a\UnitTest.Utils\bin\Release\UnitTest.Utils.dll /testcontainer:D:\TeamCity\buildAgent\work\f09bf2f330c2ab9a\UnitTest.MiddleTier\bin\Release\UnitTest.Utils.dll /resultsfile:D:\TeamCity\buildAgent\temp\buildTmp\tmpE859.tmp.teamcity.trx (Xml)
08:19:32.180 |I|                               | /WorkingDir=D:\TeamCity\buildAgent\work\f09bf2f330c2ab9a (Xml)
08:19:32.180 |I|                               | /TempDir=D:\TeamCity\buildAgent\temp\buildTmp (Xml)
08:19:32.180 |I|                               | /Output=D:\TeamCity\buildAgent\temp\buildTmp\coverage_dotcover13940396202529873921.data (Xml)
08:19:32.180 |I|                               | /Filters=+:UnitTest.Search.dll;-:JetBrains.BuildServer.*;-:JetBrains.TeamCity.* (Xml)
08:19:32.180 |I|                               | Current directory: D:\TeamCity\buildAgent\work\f09bf2f330c2ab9a
08:19:32.180 |I|                               | Validating command...
08:19:32.182 |I|                               | Executing command...
08:19:32.247 |W|                               | Target executable doesn't exist

--- EXCEPTION #1/2 [CommandExecutionException]
Message = “Target executable doesn't exist”
ExceptionPath = Root.InnerException
ClassName = JetBrains.dotCover.Core.ConsoleRunner.CommandExecutionException
HResult = COR_E_APPLICATION=80131600
Source = JetBrains.dotCover.Core
StackTraceString = “
  at JetBrains.dotCover.Core.ConsoleRunner.Commands.Cover.CoverCommand.Execute(CommandExecutionContext context)
     at JetBrains.dotCover.Core.ConsoleRunner.ConsoleRunnerBackend.Execute(ICommandLine commandLine, Func`1 componentContainerGetter)
”

--- Outer ---

--- EXCEPTION #2/2 [LoggerException]
Message = “Target executable doesn't exist”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
InnerException = “Exception #1 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “”

08:19:32.459 |I|                               | Target executable doesn't exist.
08:19:32.459 |I|                               | Console Runner execution finished
08:19:32.459 |I| Main                          | Console Runner exit code: -2

Any suggestions you can provide to help us resolve this would be appreciated. Thanks.


Solution

  • With some help I've been able to resolve this issue which turned out to be a bad System Parameter I'd added.

    To resolve an issue with Unit Tests not working I'd added this System Parameter:

    Name:  system.MSTest.12.0
    Value: D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest
    

    This resulted in the Unit Test working but when I configured Code Coverage the "Target executable doesn't exist" error occured. To resolve this I had to update the System Parameter to:

    Name:  system.MSTest.12.0
    Value: D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe
    

    I'd made the assumption that as the Unit Tests worked the problem I had was with dotCover not MSTest and nothing in the error indicated otherwise.


    As a side note the reason I had to add the System Parameter was because Teamcity isn't auto detecting the install of MSTest. I think this is due to it being installed on a different drive but I can't confirm this. I've raised it with JetBrains so hopefully they can resolve it.