JsonSerializer error in Visual Studio 2022 (preview)
See original GitHub issueHi all, When calling GetDiscoveryDocumentAsync in my Xamarin.Forms project, inside Vs2022 i get this error
_discoveryResponse = await _tokenClient.GetDiscoveryDocumentAsync(new DiscoveryDocumentRequest
{
Address = App.Current.AppSettings.AuthEndpointUrl,
});
Error connecting to endpoint Error connecting to https://{myidentityserverurl}/.well-known/openid-configuration/jwks. The type initializer for ‘System.Text.Json.JsonSerializer’ threw an exception.
This not happen when using VS 2019 or from device (without debugger attached)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (4 by maintainers)
Top Results From Across the Web
c# - How do I fix the error "Could not load file or assembly ' ...
Solution for me was updating Visual Studio to the latest version that came with .NET 7 SDK and updating the project target framework...
Read more >StreamJsonRpc.RemoteInvocationException while ...
Fresh install of Visual Studio 2022 results in a StreamJsonRpc.RemoteInvocationException exception... Checked the log under C:\Users[myId]\AppData\Local\Temp\ ...
Read more >How to serialize and deserialize JSON using C# - .NET
To write JSON to a string or to a file, call the JsonSerializer.Serialize method. The following example creates JSON as a string: C#...
Read more >Blazor WASM Dotnet6-Preview7, InvalidOperationException ...
InvalidOperationException: There was an error parsing the event arguments. EventId: '2'. ... Json.Serialization. ... Visual Studio 2022 (17.0.0 Preview 3.0) ...
Read more >Support "import" statement in module interface files. #3424
Description I'm using MSVC 2022 with /std:c++20. I'm trying to import single_include version 3.10.5 into my module interface file (*.ixx).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi I encountered this problem with a Xamarin.Forms app and found a solution here.
I have a working example in the WebAuthenticatorDemo-OIDCClient folder.
I used the nuget package references:- IdentityModel.OidcClient v5.0.0 System.Text.Json v6.0.2
Add this to the iOS project file:-
Set the project (Xamarin.Forms in this case) to use .Net standard 2.1
Hope this helps
@amellini I used your text reporting the problem and registered it in the visual studio community. Follow the link below. If everyone reinforces the request, it would help.
https://developercommunity.visualstudio.com/search?space=61&q=System.Text.Json.JsonSerializer+error+visual+studio+2022