我们正在尝试设置 Teamcity,但在添加代码覆盖率时遇到问题,导致“目标可执行文件不存在”错误消息。
目前构建配置是否包含两个步骤;第一步是运行器类型 Visual Studio (sln),第二步是运行器类型 MSTest。在我们将 .NET Coverage 添加到 MSTest 步骤之前,它们运行良好。我们对 .NET Coverage 的配置是:
- .NET Coverage 工具:JetBrains dotCover dotCover 的路径
- 主页:{空白}
- 过滤器:+:UnitTest.Search.dll
- 属性过滤器:{无}
我们还尝试将 dotCover Home 路径和额外权限添加到构建服务器上的 Teamcity 文件夹,但错误仍然一致。我们添加了“teamcity.agent.dotCover.log”配置参数,它为我们提供了以下输出:
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
您可以提供任何帮助我们解决此问题的建议将不胜感激。谢谢。