question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conflict with System.text.json

See original GitHub issue

Not an issue with the SessionStorage code, but prevents its use in Blazor server apps.

Affects SessionStorage and LocalStorage. I get the same log info from msbuild as reported here: https://github.com/dotnet/aspnetcore/issues/23126

App runs as expected despite warning locally but crashes in hosted setting yielding:

An unhandled exception has occurred while executing the request. 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’ at Blazored.SessionStorage.SessionStorageService…ctor(IJSRuntime jSRuntime, IOptions`1 options)

To Reproduce Include library in trivial blazor server app. Compile.

Warning MSB3277 Found conflicts between different versions of “System.Text.Json” that could not be resolved.

Hosting Model (is this issue happening with a certain hosting model?):

  • Blazor Server

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
AdamJonssoncommented, Aug 7, 2020

I myself fixed it by installing the System.Text.Json from NuGet. I am really new to the whole .NET environment, so take this solution with some kilograms of salt 😅

1reaction
chrissaintycommented, Jul 20, 2020

Sorry, it’s taken a while to look at this. I’ve added a comment to the issue @bstorage linked in the opening comment, suggesting your fix @larsk2009. I’ll wait to hear back from that before doing anything as I’m not sure what the impact of changing the target framework would be.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.Text.Json version conflict
I have a solution with 2 projects: ... I tried explicitly installing the System.Text.Json 4.7.2 into the netstandard2.1 project. The app now ...
Read more >
System.IO.FileNotFoundException thrown when using ...
The issue we are facing is with System.Text.Json. We have installed the 6.0.5 nuget package to the projects that require it but since...
Read more >
Conflict in Property Serialization with System.Text.Json ...
Description When running a newly created minimal WebAPI in 8.0.100-preview.6.23330.14, an InvalidOperationException occurs during property serialization ...
Read more >
Migrate from Newtonsoft.Json to System.Text.Json - .NET
System.Text.Json is strict by default and avoids any guessing or interpretation on the caller's behalf, emphasizing deterministic behavior. The ...
Read more >
MSB3277: Found conflicts between different versions of ' ...
This error occurs during a build when more than one version of the same dependent assembly is referenced in a build of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found