我正在使用NDepend 6和TeamCity 10.0.2,并且在NDepend构建步骤中遇到错误。查看构建日志,显示:
[步骤6/9]恢复趋势存储(1s)
[17:59:26][Restoring trend store] Requesting last finished build http://localhost/httpAuth/app/rest/buildTypes/ProjectName/builds?locator=count:1,personal:false,canceled:false,tags:ndepend_metrics
[17:59:27][Restoring trend store] Restoring trend store to C:\TeamCity\buildAgent\work\d91e7b421f32292a\LastTrendMetrics.zip
[17:59:27][Restoring trend store] Downloading artifact http://localhost/httpAuth/app/rest/builds/id:5783/artifacts/content/NDependOut/TrendMetrics.zip to C:\TeamCity\buildAgent\work\d91e7b421f32292a\LastTrendMetrics.zip
[17:59:29]
[Step 6/9]
Exception.Type {System.Net.WebException}
Exception.Message {The remote server returned an error: (400) Bad Request.}
Exception.StackTrace {
System.Net.WebClient.DownloadFile(Uri address, String fileName) L_00ca
NDepend.TeamCity.Artifacts.RestoreTrendStore.DownloadTrendStoreZip(Int32 lastFinishedBuildId, String lastTrendMetricsZip) L_003c
NDepend.TeamCity.Artifacts.RestoreTrendStore.DoRestore() L_006b
NDepend.TeamCity.Artifacts.RestoreTrendStore.Restore() L_0011
NDepend.TeamCity.NDependRunner.RestoreArtifacts() L_001c
NDepend.TeamCity.NDependRunner.Run() L_0006
NDepend.TeamCity.Program.MainSub(String[] args) L_002c
}
Exception.InnerException = null
查看来自网址的实际回复:
URL: http://localhost/httpAuth/app/rest/builds/id:5783/artifacts/content/NDependOut/TrendMetrics.zip
RESPONSE:
Responding with error, status code: 400 (Bad Request).
Details: jetbrains.buildServer.server.rest.errors.BadRequestException: Cannot provide children list for file ''.
Invalid request. Please check the request URL and data are correct.
这一切在TeamCity 9中都运行良好;移动到新服务器并升级到TeamCity 10后,问题就开始发生了。我不一定关心NDepend的内部趋势跟踪,所以如果有一些方法可以禁用这部分分析,那也没关系。