Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading a Blazor server side project dependencies results in a failure to load an assembly #22052

Closed
MarkStega opened this issue May 20, 2020 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Fixed The bug or enhancement requested in this issue has been checked-in!

Comments

@MarkStega
Copy link

MarkStega commented May 20, 2020

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

var authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(ParseClaimsFromJwt(jwToken), "jwt"));

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>

@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label May 20, 2020
@simonziegler
Copy link

Likewise I have this problem. It's rather drastic. Thanks for looking into it.

@chucker
Copy link

chucker commented May 20, 2020

@MarkStega that output looks like you don't have the current runtime (3.1.4 instead of 3.1.2) or SDK (3.1.300 final instead of preview). It seems like the current VS preview ships with an old version.

Not sure if that's the reason, though.

@MarkStega
Copy link
Author

@chucker That was the issue. VS 16.7.0Preview1 ships with an older runtime then 16.6.0 release. I believe that bundling the sdk with VS is a mistake if newer VS releases can't be relied upon to have updated sdk/runtimes.

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Fixed The bug or enhancement requested in this issue has been checked-in! label May 21, 2020
@MarkStega
Copy link
Author

MarkStega commented Jun 3, 2020

@mkArtakMSFT I don't think that the VS bundling issue is fixed. VS 16.7.0 Preview2 with a 3.1.400-preview-015151 SDK became available yesterday but still installs the 3.1.2 runtimes rather than the up-to-date 3.1.4 runtimes.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Fixed The bug or enhancement requested in this issue has been checked-in!
Projects
None yet
Development

No branches or pull requests

5 participants