Upgrading a Blazor server side project dependencies results in a failure to load an assembly #22052
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Fixed
The bug or enhancement requested in this issue has been checked-in!
I have a Blazor project that fails with "Error: System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
File name: 'System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
" after updating the assemblies.
To Reproduce
This is a server side blazor project. I upgraded the following assemblies from 3.1.3 to 3.1.4:
Microsoft.AspNetCore.Authentication.JwtBearer
Microsoft.AspNetCore.Authorization
Microsoft.AspNetCore.Components
Microsoft.AspNetCore.Components.Authorization
Microsoft.AspNetCore.Components.Web
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
Microsoft.Extensions.Http
Microsoft.Extensions.Logging
Microsoft.Extensions.Logging.Debug
and after that upgrade I get the error referenced above on a line of code that has
Reverting to 3.1.3 versions of the assemblies gives me a running application again. All NuGet packages are release level except for all of the Grpc packages which are 0.29.0-pre1.
Further technical details
Attached is a detailed build log that has an error resolving System.Text.Json. See line 27950
build.log
C:\Solutions\OHI\Optimiser>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.300-preview-015135
Commit: 0b3c572e97
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.300-preview-015135\
Host (useful for support):
Version: 5.0.0-preview.4.20251.6
Commit: 47ec733ba7
.NET SDKs installed:
2.1.803 [C:\Program Files\dotnet\sdk]
3.1.300-preview-015135 [C:\Program Files\dotnet\sdk]
5.0.100-preview.4.20258.7 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-preview.4.20257.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-preview.4.20251.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0-preview.4.20251.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
C:\Solutions\OHI\Optimiser>
The text was updated successfully, but these errors were encountered: