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
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2018-06-19 NPOI设置Excel中的单元格识别为日期
2017-06-19 FileStream vs/differences StreamWriter?
2017-06-19 Excel显示当前日期
2015-06-19 编程概念--使用async和await的异步编程
2014-06-19 Winform中使用折叠窗口