Newtonsoft.Json源碼的solution打開之后,無法加載project


無法加載項目

https://github.com/JamesNK/Newtonsoft.Json

C:\repository\GitHub\Other\Newtonsoft.Json\Src\Newtonsoft.Json\Newtonsoft.Json.csproj : error : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.

Detailed Information:
Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.

 

查看根目錄下的global.json文件

{
"sdk": {
"version": "2.2.105"
}
}

 

本地環境缺少2.2.105

https://chocolatey.org/packages/dotnetcore-sdk/2.2.105

使用choco進行安裝

 

編譯失敗

Error occurred while restoring NuGet packages: The operation failed as details for project Newtonsoft.Json could not be loaded.
1>------ Build started: Project: Newtonsoft.Json, Configuration: Release Any CPU ------
1>C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1004: Assets file 'C:\repository\GitHub\Other\Newtonsoft.Json\Src\Newtonsoft.Json\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
1>Done building project "Newtonsoft.Json.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets(41,3): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\Portable\v4.0\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
1>Done building project "Newtonsoft.Json.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets(41,3): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
1>Done building project "Newtonsoft.Json.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1004: Assets file 'C:\repository\GitHub\Other\Newtonsoft.Json\Src\Newtonsoft.Json\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
1>C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1004: Assets file 'C:\repository\GitHub\Other\Newtonsoft.Json\Src\Newtonsoft.Json\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
1>C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1004: Assets file 'C:\repository\GitHub\Other\Newtonsoft.Json\Src\Newtonsoft.Json\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
1>Done building project "Newtonsoft.Json.csproj" -- FAILED.

 

C:\repository\GitHub\Other\Newtonsoft.Json\Src\Newtonsoft.Json\Newtonsoft.Json.csproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project.

https://github.com/JamesNK/Newtonsoft.Json/issues/2057#issuecomment-493294589

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM