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.
4 comments
Comment actions Permalink

Hi Wayne,

Sorry for delay. The error "Target executable doesn't exist" means that dotCover could not find MSTest.exe. How did you specify path to MSTest.exe? Please attach screenshot of the build step settings.

0
Comment actions Permalink

Hi Alina,

Thanks for the reply.  As you can see from the screenshot below, for the MSTest path we've selected MSTest 2013 from the available options.

Teamcity build step.png
(*All other fields available on the build step that can't be seen on this screenshot are blank)

We have also got a system property set up for the MSTest path because Teamcity didn't seem to be auto detecting the MSTest installation.  I've added a screenshot of this below in case it proves useful.

Teamcity system prop.png

Thanks.

0
Comment actions Permalink

Please specify full path to MSTest.exe in system.MSTest.12.0 parameter:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe

It's strange that TeamCity didn't auto detect MSTest. Please check InstallDir attribute using regedit.exe:

for 32bit HKEY_LOCAL_MACHINE/Software/Microsoft/VisualStudio/12.0/

for 64bit HKEY_LOCAL_MACHINE/Software/Wow6432Node/Microsoft/VisualStudio/12.0/

It should be equal C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\.

0
Comment actions Permalink

Hi Alina,

I've updated the MSTest path to include the full path including the executable name plus file extension and this has resolved the "Target executable doesn't exist" error.

I still had some configuration issues but I figured out that this was due to the Filters being wrong.  What I was assuming here was that the Filters was to filter the test assemblies that you want to use to generate the coverage and the code being covered (or not covered) by these test would be worked out by the assembly references.  My personal opinion is that the wording around this option isn't quite right, but the online documentation is better (specificaly the statement "Specify assemblies to profile") and is what I used to solve the issue.

Regarding the auto detect, I've checked the registry and the path is correctly set to the install directory.  In our case this is:  D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\.  I'm not sure why it's not being found the only difference I can see is the installation drive.

Thanks for your help.

0

Please sign in to leave a comment.