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

Notification

Icon
Error

GridNode Net 6 - target "Build" does not exist
9swampy
#1 Posted : Wednesday, May 11, 2022 8:43:36 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/8/2016(UTC)
Posts: 13
Location: United Kingdom

VS2022 with Net 6 sln, keeping it simple just a Class Library.

Builds fine and nCrunch runs tests locally no issue.

Set up a grid node, installed Net 6 SDK.
GridNode wouldn't build with error:
NCrunch was unable to parse this project file because of an unexpected error: Microsoft.Build.Exceptions.InvalidProjectFileException: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.

Install MsBuild via 2022 Installer -> Individual Components
GridNode won't build with error:
The target "Build" does not exist in the project.

Builds fine from the command line "dotnet restore && dotnet msbuild" from a local CMD prompt.

Following relevant advice gleaned from forum running the GridNode in a console host to produce:
Now initialising NCrunch Grid Node using console host. Version is 4.11.0.2
Grid node successfully started and is listening for connections on port 41141
[PID:10740 21:06:15.2081 ?-1] Node server started - listening on port 41141
[PID:10740 21:08:55.2551 Core-13] Client connection accepted from 192.168.xxx.126:50264
[PID:10740 21:08:55.2711 Core-13] Creating server-side handler for 192.168.xxx.126:50264
[PID:10740 21:08:55.2711 Core-13] Describing self to 192.168.xxx.126:50264
[PID:8176 21:13:01.8331 ?-10] The target "Build" does not exist in the project.
[PID:10740 21:13:02.1301 NodeProcessor-255] ERROR (Build): xxxNet: C:\NCrunch Grid Node\10740\1\xxxNet\xxxNet.csproj (0): The target "Build" does not exist
in the project.

Any suggestions what's missing?

Forgot to say FWIW I set nCrunch logging to detailed and the GridNode just returns one line "no build target" but if you'd like me to send the log from the successful local build let me know and I'll email.

dotnet --version
6.0.300

dotnet msbuild --version
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

17.2.0.20702

Found another pointer and set DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR = "C:\Program Files\dotnet". No difference.

Simplifying further added new Class Library with default content; builds local, fails with same error on the node. Literally VS2022->Add new Class Library->Select NEt6
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

with default Class1. Same "No build target" error.
Remco
#2 Posted : Wednesday, May 11, 2022 10:51:52 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this.

Can you confirm whether the grid node is able to build this project without NCrunch involved? (i.e. just using MSBuild tools or VS on the node).
9swampy
#3 Posted : Thursday, May 12, 2022 6:57:00 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/8/2016(UTC)
Posts: 13
Location: United Kingdom

Builds fine on the GridNode using the command lines "dotnet restore && dotnet msbuild" from a local CMD prompt.
Remco
#4 Posted : Thursday, May 12, 2022 8:08:27 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
9swampy;16120 wrote:
Builds fine on the GridNode using the command lines "dotnet restore && dotnet msbuild" from a local CMD prompt.


Does the grid server have MSBuild Tools or Visual Studio installed? Unfortunately NCrunch is not integrated with dotnet build and must have MSBuild present on the machine to be able to build projects.
9swampy
#5 Posted : Thursday, May 12, 2022 11:57:09 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/8/2016(UTC)
Posts: 13
Location: United Kingdom

It does not have a full Visual Studio install, only the MsBuild Individual Component. Just pointing msbuild at
the sln wasn't happy though, iirc something to do with Net461 which didn't make a whole lot of sense without further investigatingthe command line options. I'll tryagain this evening and post the result.

If you could suggest a commandline to use to give info you need let me know.
Remco
#6 Posted : Thursday, May 12, 2022 1:57:00 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Unfortunately, the MSBuild.exe component on its own isn't usually enough, as we need the entire build system full of platform libraries that go with it.

MS do have a distribution of MSBuild Tools which is essentially a headless version of VS. I believe it's a free download and is actually represented as a version of VS on the machine (according to the APIs). They intend for this to be used in build servers but it can also work with NCrunch grid nodes.
9swampy
#7 Posted : Thursday, May 12, 2022 5:39:49 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/8/2016(UTC)
Posts: 13
Location: United Kingdom

Ok, found and installed "Build Tools for Visual Studio 2022" from https://visualstudio.mic...ownloads/?q=build+tools

Even with that installed nCrunch comes back same error; but even msbuild (parameterless) while it works on Dev machine with full VS installed it still fails on the GridNode with mbs4236 & a global.json doesn't seem to help.

If you can offer any advice (even if it's no chance; you couldn't get it to work either fair) to get this working I'd gratefully receive as I really don't want to load a full VS if it can be avoided; but I appreciate this is more a MS issue than nCrunch... will revert with findings either way.
9swampy
#8 Posted : Thursday, May 12, 2022 6:19:16 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/8/2016(UTC)
Posts: 13
Location: United Kingdom

FWIW

On full VS install msbuild cmdline outputs
[...]
Resolving SDK 'Microsoft.NET.Sdk'...
Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild;$(MSBuildProgramFiles32)\MSBuild
Trying to import C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\$(MSBuildToolsVersion)\Microsoft.Common.props using extensions path C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild
Property reassignment: $(MSBuildProjectExtensionsPath)="C:\Git\TypTut\GitModules\FakelishNet\FakelishNet\obj\" (previous value: "obj\") at C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Microsoft.Common.props (57,5)
Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild;$(MSBuildProgramFiles32)\MSBuild
Trying to import C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\$(MSBuildToolsVersion)\Imports\Microsoft.Common.props\ImportBefore\* using extensions path C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild
The "Configuration" property is a global property, and cannot be modified.
The "Platform" property is a global property, and cannot be modified.
Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild;$(MSBuildProgramFiles32)\MSBuild
Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild;$(MSBuildProgramFiles32)\MSBuild
The "Configuration" property is a global property, and cannot be modified.
The "Platform" property is a global property, and cannot be modified.
Resolving SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator'...
Resolving SDK 'Microsoft.NET.ILLink.Tasks'...
Property reassignment: $(TargetsForTfmSpecificContentInPackage)=";PackTool;_PackProjectToolValidation" (previous value: ";PackTool") at C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.PackProjectTool.props (15,5)

...but on GridNode with only VS Build Tools 2022 & Net 6 SDK:
[...]
Resolving SDK 'Microsoft.NET.Sdk'...
[...and then next line we get the fail]
9swampy
#9 Posted : Thursday, May 12, 2022 10:53:08 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/8/2016(UTC)
Posts: 13
Location: United Kingdom

Lame but not wholly unanticipated outcome; I set up another node with a minimal for our needs full install of VS2022 with which nCrunch is happy.

ROI on VS Build Tools for 2022 with several evenings expended is 0. Even msbuild still doesn't work. YMMV; and please reopen/reply here if you do better.

For us:

  • msbuild can't/doesn't/won't resolve the NetCore.Sdk.
  • dotnet msbuild is happy as...

FWIW a prior workplace foisted a VS Enterprise licence upon me just so I could report back that for all that extra expense MsLiveUnitTest just doesn't come close.
A full [minimal] install of VS on the node is a small price to pay for orders of magnitude better experience.
Keep up the good work; and let us know when you overcome the "dotnet msbuild" incompatibilities.
Remco
#10 Posted : Friday, May 13, 2022 12:15:38 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Sorry for the awful experience here. If it feels any better, I understand your pain ... We deal with a multitude of different build systems and platform environments here and the maze of unhelpful error messages doesn't help things.

Previously, installing the MSBuild Tools was usually enough for a grid node to work without problems, though I've noticed in the past that this variant of VS seems to be a bit of an afterthought in the world of .NET, and it very often tends to fall into various levels of forgotten and broken, much to the frustration of anyone using it for a build server.

There are other options available that don't require a full-on expensive enterprise license of VS. In theory, the community version of VS does also install the critical components needed to build solutions across versions of .NET. It is also possible to install a full version of VS but simply never access the IDE to activate the licensing, and it will still have the components needed for NCrunch to work. I cannot comment on the legality of these approaches in terms of Microsoft's EULA as I'm entirely unqualified to do so.

I'm making a task to have a closer look at the 'dotnet build' system to see what APIs this supports and whether there are any integration opportunities for us. It may be that with some work we can eventually bypass this problem entirely.
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.084 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download