dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.71k stars 1.07k forks source link

Compile Error with DOTSDK 9.0.100-rc.1 #43340

Closed wanggangzero closed 1 month ago

wanggangzero commented 1 month ago

Describe the bug

A clear and concise description of what the bug is. When I compile my library with SDK 9.0 rc.1, it show's: Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

To Reproduce

create an emputy project(framework use .net8.0), and add using System.Text.Json; write some code or not. then compile it. (to avoid this Exception, you can place a global.json to specify the version sdk 8.0.401)

Exceptions (if any)

严重性 代码 说明 项目 文件 行 禁止显示状态 错误(活动) NETSDK1060 读取资产文件时出错: Error loading lock file 'R:\ClassLibrary1\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. 系统找不到指定的文件。 ClassLibrary1 C:\Program Files\dotnet\sdk\9.0.100-rc.1.24452.12\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 266

Further technical details

运行时环境:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-rc.1.24452.12\

已安装 .NET 工作负载:
配置为在安装新清单时使用 loose manifests。
[aspire]
安装源文件: VS 17.11.35303.130
清单版本: 8.1.0/8.0.100
清单路径: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.1.0\WorkloadManifest.json
安装类型: FileBased

Host:
Version: 9.0.0-rc.1.24431.7
Architecture: x64
Commit: static

.NET SDKs installed:
6.0.425 [C:\Program Files\dotnet\sdk]
8.0.400 [C:\Program Files\dotnet\sdk]
8.0.401 [C:\Program Files\dotnet\sdk]
9.0.100-rc.1.24452.12 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

已安装的版本: Community

Visual C++ 2022 00482-90000-00000-AA119 Microsoft Visual C++ 2022

ASP.NET and Web Tools 17.11.231.19466 ASP.NET and Web Tools

Azure Functions and Web Jobs Tools 17.11.231.19466 Azure Functions and Web Jobs Tools

Azure 应用服务工具 3.0.0 版 17.11.231.19466 Azure 应用服务工具 3.0.0 版

C# 工具 4.11.0-3.24428.4+1ea9c390a5bb6815fdff2137ee155e23e78d6ff3 IDE 中使用的 C# 组件。可能使用其他版本的编译器,具体取决于你的项目类型和设置。

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

GitHub Copilot 0.2.1648.49400 GitHub Copilot 是一个 AI 配对程序员,可帮助你更快地编写代码,并减少工作量。

ILSpy.AddIn 1.0 可以在 Visual Studio 中直接打开反编译工具 ILSpy 。

IndentRainbowPackage Extension 1.0 IndentRainbowPackage Visual Studio Extension Detailed Info

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

NuGet 包管理器 6.11.0 Visual Studio 中的 NuGet 包管理器。有关 NuGet 的详细信息,请访问 https://docs.nuget.org/

Razor (ASP.NET Core) 17.11.3.2442001+68650a7d94261bc56a1f4bc522c2ee35314b1abb 提供 ASP.NET Core Razor 的语言服务。

SQL Server Data Tools 17.11.38.0 Microsoft SQL Server Data Tools

TypeScript Tools 17.0.30715.2002 TypeScript Tools for Microsoft Visual Studio

Visual Basic 工具 4.11.0-3.24428.4+1ea9c390a5bb6815fdff2137ee155e23e78d6ff3 IDE 中使用的 Visual Basic 组件。可能使用其他版本的编译器,具体取决于你的项目类型和设置。

Visual F# Tools 17.11.0-beta.24421.7+af2f522de602281d4ef5a7b71507c428e814c5c1 Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2 Visual Studio 的 AI 协助开发。

Visual Studio Tools for Unity 17.11.2.0 Visual Studio Tools for Unity

Youssef1313 commented 1 month ago

Duplicate of https://github.com/dotnet/sdk/issues/43339

wanggangzero commented 1 month ago

Duplicate of #43339

Yes! Please close it.