Build/Test Issues

Can't build on grid node

Started by xiaomingtu on 7,059 views

Hi,

I got this error when I build my project on a grid node:

..\..\..\..\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (917, 7): The target "AssignLinkMetadata" does not exist in the project.

I use VS2015 Professional locally and have VS2015 Community installed on the grid node.

I have seen a similar issue on this post but there is not solution provided.
http://forum.ncrunch.net/yaf_postst1848_Inconsistent-build-across-Grid-Nodes.aspx

Thanks!
Xiaoming
Hi Xiaoming,

This problem is caused by a cross-version issue between your dev machine and the grid node.

Basically, your dev machine is building the project using the VS2015 build tools, while the grid node is using an older set of tools.

NCrunch will normally use the same set of build tools on a grid node as it does on the client machine. Where it can't resolve the same tools, it will use an older version as a fallback.

Can you check if you have the file 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL' installed in the GAC on the grid node server? NCrunch looks for this assembly when deciding whether it can use MSBuild for VS2015.

A way to work around this is to try adding the missing build target directly to your project files. For example:

<Target Name="AssignLinkMetadata" Condition="'$(NCrunch)' == '1'">
</Target>

This may get you past the problem, though it may cause some differences in behaviour around how Link files are copied for the project (usually not a problem as most people don't use this feature).
Hi Remco,

I have checked that the file 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL' is installed in the GAC on the grid node server.

I do not want to change the project file since it works fine on my dev machine.
Would it be possible for you to get hold of a log on the grid node server of when it tries to build one of these projects?

You can turn on logging in the grid node configuration tool. Make sure you point it to an area of your hard drive where you can easily find the log. The grid node should specify in the log if it's using a different version of MSBuild than was requested by the grid client. This will help us to determine whether the grid node is using the wrong version of MSBuild, or whether it's the build logic itself going wrong.

If you haven't already, I do also recommend copying one of these projects over to the node and trying to run MSBuild 14 over it to see what happens. You can normally find this at C:\Program Files (x86)\MSBuild\14.0\Bin
Thanks Remco! I copied one project to the grid node and use MSBuild to build it directly. It succeeds. Then I enabled the log and try to reproduce the problem but it all works fine from then on. Even if I have disabled logging, it works now. No idea what happened.
xiaomingtu wrote:Thanks Remco! I copied one project to the grid node and use MSBuild to build it directly. It succeeds. Then I enabled the log and try to reproduce the problem but it all works fine from then on. Even if I have disabled logging, it works now. No idea what happened.


We have a mystery! I'm glad you're working again. Let me know if you find a consistent way to reproduce it.

Edited

Post a reply

Log in to reply.