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

Notification

Icon
Error

3 Pages<123
NCrunch cannot build .NET Standard 2.0 projects
Remco
#41 Posted : Wednesday, December 1, 2021 12:36:54 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
I've done some experimentation here with a local VM and I'm wondering if you could try a few things for me.

The relevant item here is the protobuf-net.csproj.nuget.g.props inside the obj directory in the workspace on the grid node. This file contains the references to the Nuget package root used by the build system, and is the main way MSBuild finds the packages required to build the project.

When performing grid processing, NCrunch copies all required packages from the client machine over to the grid node, storing them in a fixed path (usually C:\NCrunch Grid Node\Snapshots\.nuget). The above .props file is then modified to point to the new package path on the grid node.

If you examine the above file, you'll see there are a couple of areas of interest. Firstly, we have the NuGetPackageRoot and NuGetPackageFolders properties. I note in the file you provided that these seem to be correctly repointed to the .nuget directory on the node. The second area of interest is the SourceRoot items. These seem to be a relatively new development in the platform and we don't have any logic in NCrunch that repoints these to paths on the node. However, in my own testing they don't seem to be relevant, as my VM can build the project even when these point to non-existent paths.

The first thing to try here is to run MSBuild.exe directly over the project as it exists in the NCrunch workspace on the grid node, without the /t:restore option used first. In theory, this should fail to build with the same error as that raised by NCrunch (if not, please let me know). This establishes a baseline for our known failure.

Next, you need to make selective modifications to the protobuf-net.csproj.nuget.g.props file to bring it into alignment with the file you sent me earlier when the build was working (after the /t:restore). I'm expecting that there is a specific thing in this file that when changed will solve the problem. You can run MSBuild.exe over the project as many times as you need to in order to deduct the source of this problem.

It's entirely possible that the problem isn't caused by something wrong in the protobuf-net.csproj.nuget.g.props file, in which case the next step will likely be to take a closer look at the packages stored in the .nuget directory to see if anything is missing.

Sorry, this is the process I would follow with troubleshooting this issue myself, but as none of our environments reproduce the issue, we need to do it this way.
Marcello
#42 Posted : Thursday, December 2, 2021 11:39:45 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/16/2019(UTC)
Posts: 70
Location: Italy

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Hi Remco,

I think the problem is in protobuf-net.csproj.nuget.g.targets as shown in these images.

I manually copied the folder netstandard.library\2.0.3 to the server and changed the path in the .targets file and it works fine with MsBuild.

Please have a look at this video and let me know your thoughts.

It seems that NCruch look at the folder C:\Program Files\dotnet\sdk\NuGetFallbackFolder that does not exist in this machine. Make it sense?
Remco
#43 Posted : Thursday, December 2, 2021 11:42:57 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Great work, I think you've found it. Here is the .nuget.g.targets file as it exists on my machine (prior to being uploaded to the grid node):

Code:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</ImportGroup>
</Project>


So it seems that this file is different between our systems. This would be why you're seeing the error but I'm not. I can't find anywhere we actually manipulate this file inside NCrunch - we simply copy it over to the node. Can you check to see what the contents of this file are on your client machine at the time you connect to the grid node? I think the toolset on your side may be doing things to this file that we haven't seen before.
Marcello
#44 Posted : Friday, December 3, 2021 7:59:58 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/16/2019(UTC)
Posts: 70
Location: Italy

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Listed below is the content of protobuf-net.csproj.nuget.g.targets in my local machine

Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
  </PropertyGroup>
  <ImportGroup Condition=" '$(TargetFramework)' == '' AND '$(ExcludeRestorePackageImports)' != 'true' ">
    <Import Project="$(NuGetPackageRoot)nerdbank.gitversioning\2.1.65\buildCrossTargeting\Nerdbank.GitVersioning.targets" Condition="Exists('$(NuGetPackageRoot)nerdbank.gitversioning\2.1.65\buildCrossTargeting\Nerdbank.GitVersioning.targets')" />
  </ImportGroup>
  <ImportGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' AND '$(ExcludeRestorePackageImports)' != 'true' ">
    <Import Project="$(NuGetPackageRoot)sourcelink.create.github\2.8.3\build\SourceLink.Create.GitHub.targets" Condition="Exists('$(NuGetPackageRoot)sourcelink.create.github\2.8.3\build\SourceLink.Create.GitHub.targets')" />
    <Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
    <Import Project="$(NuGetPackageRoot)nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('$(NuGetPackageRoot)nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets')" />
  </ImportGroup>
</Project>


And here are Info get from Visual Studio used for my test

Code:
Microsoft Visual Studio Professional 2019
Version 16.11.7
VisualStudio.16.Release/16.11.7+31911.196
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Professional

Visual C++ 2019   00435-20310-73591-AA000
Microsoft Visual C++ 2019

.NET Portability Analyzer   1.1.10808.0
Evaluates portability of assemblies across .NET platforms.

ASP.NET and Web Tools 2019   16.11.94.52318
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2012   16.11.94.52318
For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2019   16.11.94.52318
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.11.94.52318
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   16.11.94.52318
Azure Functions and Web Jobs Tools

C# Tools   3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   2.11.106.19330
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

JetBrains ReSharper 2021.3 EAP 8   Build 213.0.20211113.74226-eap08
JetBrains ReSharper package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper. Copyright © 2021 JetBrains, Inc.

Microsoft Azure Tools for Visual Studio   2.9
Support for Azure Cloud Services projects

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.113+g422d40002e.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Multiline Search and Replace   3.2
Adds multiline search and replace functionality to Visual Studio.

NCrunch   
Continuous Testing Tool for .NET
Copyright � 2010-2021 Remco Software Ltd

NuGet Package Manager   5.11.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

NVIDIA Nsight Visual Studio Edition   2019.3.0.19222
NVIDIA Nsight Visual Studio Edition provides tools for GPGPU and graphics development.  Copyright © NVIDIA 2010 - 2019.
•Direct3D® and DirectX® are registered trademarks of Microsoft Corporation in the United States and/or other countries.
•Microsoft Detours is used under the Professional license (http://research.microsoft.com/en-us/projects/detours/).
•Gardens Point Parser Generator Copyright 2005 Queensland University of Technology (QUT). All rights reserved.
•NLog Copyright © 2004-2006 Jaroslaw Kowalski (jaak@jkowalski.net)
•IronPython and WPFToolkit used under Microsoft Public License (Ms-PL) and are Copyright © Microsoft Corporation
•Portions of RadControls for WPF © 2010-2011 by Telerik Corporation.  All rights reserved.
•zlib and libpng used under the zlib/libpnc license (http://opensource.org/licenses/Zlib) 
•QtSingleApplication Copyright 2013 Digia Plc and/or its subsidiary(-ies).
•Font Awesome Copyright 2018 Fonticons, Inc.

Warning: This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.

NVIDIA Nsight Visual Studio Edition - CUDA support   2019.3.0.19222
NVIDIA Nsight Visual Studio Edition - CUDA support provides tools for CUDA development and debugging.

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Razor (ASP.NET Core)   16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725
Provides languages services for ASP.NET Core Razor.

ShelvesetComparerPackage Extension   1.0
ShelvesetComparerPackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62111.11070
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TFS Source Control Explorer Extension   1.0
Visual Studio Extension for Team Foundation Server Source Control Explorer

TypeScript Tools   16.0.30526.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   16.11.0-beta.21514.6+b6c2c4f53ea3a08fa603ea93d6d2f808a62a21d1
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

VSdocman   9.4
Documentation generator and code commenter.
http://www.helixoft.com
Copyright (c) Helixoft
Remco
#45 Posted : Saturday, December 4, 2021 12:29:55 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Marcello
#46 Posted : Monday, December 6, 2021 1:47:39 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/16/2019(UTC)
Posts: 70
Location: Italy

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Can v4.12.0.1 be installed side-by-side with v4.11.0.2?

I ask this because when we upgraded from v.4.9 to v.4.11 all the developers here had to upgrade the client in their machine as well.
Remco
#47 Posted : Monday, December 6, 2021 9:28:16 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Marcello;15861 wrote:
Can v4.12.0.1 be installed side-by-side with v4.11.0.2?

I ask this because when we upgraded from v.4.9 to v.4.11 all the developers here had to upgrade the client in their machine as well.


Sorry, I had to change the grid protocol to implement this fix, so v4.12 won't work with earlier versions.

I recommend testing this with just a couple of machines first before rolling it out. If the fix doesn't work, I may need to change the protocol again.
Marcello
#48 Posted : Tuesday, December 7, 2021 7:56:12 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/16/2019(UTC)
Posts: 70
Location: Italy

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Do we need an additional license for v4.12.0.1?
Remco
#49 Posted : Tuesday, December 7, 2021 12:37:01 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Marcello;15863 wrote:
Do we need an additional license for v4.12.0.1?


As far as I can tell, the licenses for your site are still well within their support period, so v4.12 should work fine with your existing licenses.
Marcello
#50 Posted : Tuesday, December 7, 2021 3:33:48 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 9/16/2019(UTC)
Posts: 70
Location: Italy

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Hi Remco,

The new build fixes the issue!

Thanks a lot for your effort.
Remco
#51 Posted : Tuesday, December 7, 2021 11:49:27 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Marcello;15865 wrote:
Hi Remco,

The new build fixes the issue!

Thanks a lot for your effort.


Great to hear! Thanks for your patience. We got there in the end :)
Users browsing this topic
Guest
3 Pages<123
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.070 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download