Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Grid Node + MSBuild 14 detection
jschreuder
#1 Posted : Tuesday, April 19, 2016 3:13:44 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/5/2015(UTC)
Posts: 42
Location: Australia

Thanks: 14 times
Was thanked: 23 time(s) in 11 post(s)
Hi,

I'm giving the grid node thing a try on a fresh Azure VM.

My tests are running and failing, and the logs show a bunch of errors related to my usage of fat arrows which were introduced in C#6.

I assume this is the reason:
Quote:

WARNING - NCrunch: This project has been built with MSBuild v4.0 because MSBuild v14.0 was not found on this server. Some build tasks may fail when not executed using the correct version of MSBuild.


However, I know for sure MSBuild 14 is installed, as I can see it on disk (installed via the VS 2015 Build Tools).



Do I need to add something to my PATH, or is the NCrunch grid node just not picking up this installation for reasons outside my control?
Remco
#2 Posted : Tuesday, April 19, 2016 4:08:52 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi, thanks for sharing this issue.

NCrunch searches for MSBuild through the presence of the "Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" assembly inside the GAC. If NCrunch can't find this file in the GAC, it won't be able to resolve the build engine and will give you this warning. Check that this assembly is installed in the GAC.
jschreuder
#3 Posted : Tuesday, April 19, 2016 5:23:00 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/5/2015(UTC)
Posts: 42
Location: Australia

Thanks: 14 times
Was thanked: 23 time(s) in 11 post(s)
Thanks, I did

Code:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools>gacutil /i "C:\Program Files (x86)\MSBuild\14.0\Bin\Microsoft.Build.dll"
via command prompt and I have progressed a little further.
1 user thanked jschreuder for this useful post.
Remco on 4/19/2016(UTC)
Peska
#4 Posted : Wednesday, January 10, 2018 7:34:40 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/9/2018(UTC)
Posts: 4
Location: Poland

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I have similar problem but with Visual Studio 2017.

When I had Visual Studio 2013 both on my local machine and on remote server, everything works as expected. Now, I'm using Visual Studio 2017 on my local computer, and Build Tools for Visual Studio 2017 on remote server. This configuration works as expected - I have TeamCity on my remote server building my project using Build Tools without problem.

Unfortunately I have hard times with nCrunch. I have this error:

Quote:
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
NCrunch: This project was built on server 'REMOTE-SERVER'
..\..\..\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (917, 7): The target "AssignLinkMetadata" does not exist in the project.


WARNING - NCrunch: This project has been built with MSBuild v4.0 because MSBuild v15.0 was not found on this server. Some build tasks may fail when not executed using the correct version of MSBuild.

NCrunch: The following files were used when building this project locally but do not seem to exist on the remote grid node responsible for building this project:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.CSharp.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.CSharp.CurrentVersion.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Imports\Microsoft.Common.props\ImportBefore\Microsoft.NuGet.ImportBefore.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.NETFramework.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.NETFramework.CurrentVersion.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\CodeAnalysis\Microsoft.CodeAnalysis.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.NETFramework.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.NETFramework.CurrentVersion.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.WinFX.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Data.Entity.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Xaml.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.WorkflowBuildExtensions.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\TeamTest\Microsoft.TeamTest.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.Docker.ImportAfter.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.Docker.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.QualityTools.Testing.Fakes.ImportAfter.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Fakes\Microsoft.QualityTools.Testing.Fakes.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.Web.ImportAfter.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\Managed.Web\Microsoft.Web.IISSupport.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.ServiceModel.targets

Often this can be caused by configuration differences between your client machine and the grid node, in which case the installed SDK directories may be different between machines. If you are experiencing consistent problems when building this project on the grid node, the missing files listed above are worth investigating as they may highlight SDKs required on the grid node that have not yet been installed. Please note that this is not necessarily an error case as projects very often build successfully on grid nodes with only a subset of the client machine's installed SDKs.


I added Microsoft.Build.dll to GAC but it didn't help:

Quote:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.1 Tools>gacutil.exe /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Build.dll"

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.1 Tools>gacutil.exe /l Microsoft.Build
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.

The Global Assembly Cache contains the following assemblies:
Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL


I checked all *.targets files and they are on server, only under different path. On my local machine they are located:

Quote:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\


On server:

Quote:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\


Any ideas how can I solve this problem?
Remco
#5 Posted : Wednesday, January 10, 2018 8:36:57 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
This problem is caused by the inability of NCrunch on your grid node to locate the installation of VS2017.

VS2017 is much more complicated to reference than other versions of VS, as there is no reliable central way of finding it outside of a COM API, which I've had some problems with in the past. I am uncertain of how this COM API operates without a physical installation of VS on the machine. I'm not sure how Build Tools for Visual Studio 2017 qualifies - this use case has not been tested and I cannot guarantee that it will work. It's quite possible that you may need to physically install VS on the grid node itself.

Try setting an "NCrunchVSInstallPath.VS2017" environment variable on the grid node server with a value set to the directory 3 levels below MSBuild.exe as it exists on the grid node server. So for example, if your MSBuild.exe is under:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin", then you should set this environment variable to "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"

Make sure the environment variable is defined at system level and that the grid node service is restarted after it's declared. If in doubt, reboot the machine.
1 user thanked Remco for this useful post.
Peska on 1/10/2018(UTC)
Peska
#6 Posted : Wednesday, January 10, 2018 9:41:47 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/9/2018(UTC)
Posts: 4
Location: Poland

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Setting NCrunchVSInstallPath.VS2017 Environment variable gives me different error:

Quote:
NCrunch was unable to parse this project file because of an unexpected error: Microsoft.Build.Exceptions.InvalidProjectFileException: The tools version "15.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0".


Quick google gives me this solution:

https://github.com/dotne...#issuecomment-323235324

But in my case VSINSTALLDIR is C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools. VisualStudioVersion is unchanged = 15.0.

After that NCrunch is still giving me warning about missing files:

Quote:
NCrunch: The following files were used when building this project locally but do not seem to exist on the remote grid node responsible for building this project:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.CSharp.targets
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.CSharp.CurrentVersion.targets
(...)


But is working without problem. Thanks for help.
Remco
#7 Posted : Wednesday, January 10, 2018 10:57:54 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Great to hear, thanks for confirming!

Don't worry about the missing file warning. This is just a goto-hint if you do actually have any problems. Those files naturally won't be on the grid node because it doesn't have VS installed.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.077 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download