Newtonsoft.json: Can't build the latest revision.

Created on 24 Apr 2019  ·  5Comments  ·  Source: JamesNK/Newtonsoft.Json

Expected behavior

Build successfully.

Actual behavior

Build failed.

Steps to reproduce

Run runbuild.cmd.

Here's the log. MSB4057 in English is "The target "_GetRestoreSettingsPerFramework" does not exist in the project." It fails to restore the nuget packages I think.
I previously try to build it in VS2019 with no luck.


Windows PowerShell 脚本开始
开始时间: 20190424235101
用户名: SETO-PC\Seto
RunAs 用户: SETO-PC\Seto
配置名称:
计算机: SETO-PC (Microsoft Windows NT 10.0.17763.0)
主机应用程序: powershell -Command & { Start-Transcript 'E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Build\Temp\runbuild.txt'; Import-Module 'E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Build\psake.psm1'; Invoke-psake 'E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Build..\Build\build.ps1' ; Stop-Transcript; exit !($psake.build_success); }
进程 ID: 15284
PSVersion: 5.1.17763.316
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17763.316
BuildVersion: 10.0.17763.316
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


已启动脚本,输出文件为 E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Build\Temp\runbuild.txt
psake version 4.4.2
Copyright (c) 2010-2015 James Kovacs, Damian Hickey & Contributors
Executing Clean
Setting location to E:\Seto\GitHub\JamesNK\Newtonsoft.Json
Deleting existing working directory E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Working
Creating working directory E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Working

目录: E:\Seto\GitHub\JamesNK\Newtonsoft.Json

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2019/4/24 23:51 Working
Executing Build
Found 9 enabled builds

目录: E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Build

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2019/4/24 23:51 Temp
Downloading dotnet-install.ps1
dotnet-install: .NET Core SDK version 2.2.105 is already installed.
dotnet-install: Adding to current process PATH: "C:\Users\Seto\AppData\Local\Microsoft\dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
MSBuild path C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
Restoring packages for netstandard2.0;netstandard1.3;netstandard1.0;net45;net40;net35;net20;portable-net45+win8+wpa81+wp8;portable-net40+win8+wpa81+wp8+sl5 in E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln

用于 .NET Framework 的 Microsoft (R) 生成引擎版本 16.0.461+g6ff56ef63c
版权所有(C) Microsoft Corporation。保留所有权利。

E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json\Newtonsoft.Json.csproj : error MSB4057: 该项目中不存在目标“_GetRestoreSettingsPerFramework”。
PS>TerminatingError():“Exec: Error restoring E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln”

TerminatingError():“Exec: Error restoring E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln”
TerminatingError():“Exec: Error restoring E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln”
TerminatingError():“Exec: Error restoring E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln”
TerminatingError():“Exec: Error restoring E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln”
TerminatingError():“Exec: Error restoring E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln”
Error: 2019/4/24 23:51:08:
所在位置 E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Build\psake.psm1:147 字符: 17

  • throw ("Exec: " + $errorMessage)
  • ~~~~~~~~ [<<==>>] Exception: Exec: Error restoring E:\Seto\GitHub\JamesNK\Newtonsoft.Json\Src\Newtonsoft.Json.sln

Windows PowerShell 脚本结束
结束时间: 20190424235108


Most helpful comment

@JamesNK Thanks for your solution
After installed the ".net portable library targeting pack", the build task works now
image

All 5 comments

Just add some components to VS 2019. It's OK now.

@JamesNK

I am getting this error on windows 10 with Vs2017 and vs 2019 build tool sets, @SetoKaiba whats exactly did you do to resolve this ?

@arun-subramanian-1 Just installed all the .net sdks for 2019.

The component you need is the portable library SDK. It is not installed in VS2019 by default.

@JamesNK Thanks for your solution
After installed the ".net portable library targeting pack", the build task works now
image

Was this page helpful?
0 / 5 - 0 ratings