3
votes

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.

enter image description here

1
Which build are you running XAML build or vNext build?PatrickLu-MSFT
Fakes assemblies won't generate with VS2017 build tools installs. You may want to look at this answer at stackoverflow.com/questions/44156571/…zionyx
We're running vNext. @zionyx I know that answer, I even linked at it in the question.Lennart

1 Answers

3
votes

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