TFS 2017 不构建 Fakes 目标 [英] TFS 2017 doesn't build Fakes targets

查看:22
本文介绍了TFS 2017 不构建 Fakes 目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台安装了 VS 2017 Enterprise 的 TFS 2017 Update 2 本地服务器.我们的 Build 包含一个单元测试项目,其中包含一个 Fakes 程序集并在开发机器上本地运行.在 TFS 上构建时,构建失败并显示

<块引用>

命名空间中不存在类型或命名空间名称Fakes"'Our.Product'(您是否缺少程序集参考?)

(即未生成Our.Product.Assembly.Fakes.dll 文件)

我还按照建议设置了 Fakes

解决方案

更新

对 msbuild 参数使用最新版本,例如 /tv:15.0/p:VisualStudioVersion=15.0 可以解决此问题.


首先尝试使用构建服务帐号RDP远程构建代理,手动运行构建,查看程序集是否生成.

如果它与您在构建代理上的环境相关,这将缩小范围.确保它与您本地的开发机器相同.

如果还生成了程序集,则问题可能与您的构建定义设置有关.检查您是否使用了正确的 msbuild 版本.对于 vNext 构建,还有 使用 system.debug=true

启用详细调试模式

I have a TFS 2017 Update 2 on-prem server with VS 2017 Enterprise installed. Our Build contains a Unit-Testing project which contains a Fakes assembly and works locally on the dev machines. When build on TFS, the build fails with

The type or namespace name 'Fakes' does not exist in the namespace 'Our.Product' (are you missing an assembly reference?)

(i.e. misses/fails to generate the Our.Product.Assembly.Fakes.dll file)

I have additionally set up Fakes as suggested here.

What baffles me is that there are no mentions of Fakes in the build log (except for the error itself and the paths where MSBuild looks for the file), even with debug verbosity. He doesn't event try to generate the Fakes assembly.

Are there other steps I need to take? We use the vNext build definitions.

Update: This is the build step that works now, before the /tv:15.0 /p:VisualStudioVersion=15.0 were not there.

解决方案

Update

Use the latest version for msbuild arguments such as /tv:15.0 /p:VisualStudioVersion=15.0 could solve this issue.


First try to use build service account RDP to remote build agent and manually run the build to see if the assembly generated.

This will narrow down if it's related to your environment on the build agent. Make sure it's the same as your locally dev machines.

If the assembly is also generated, then the issue may related to your build definition settings. Check if you are using the right msbuild version. For vNext build, also enable verbose Debug Mode with system.debug=true

这篇关于TFS 2017 不构建 Fakes 目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆