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.

[Bug] [Unity] newtonsoft.json causes crashes for MSAL on unity

See original GitHub issue

Which Version of MSAL are you using ? MSAL 4.13.0

Platform net45

What authentication flow has the issue?

  • Mobile
    • Interactive
    • [] Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)
  • Web App
    • Authorization code
    • OBO
  • Web API
    • OBO

Other? - please describe;

Is this a new or existing app? This is a new app or experiment

Repro

IPublicClientApplication app = PublicClientApplicationBuilder.Create(ClientId).WithAuthority($"https://login.microsoftonline.com/{Tenant}/v2.0").Build();

Expected behavior The call method returns an IPublicClientApplication that I can use to obtain the token

Actual behavior The system launch this exceptions: ERROR: Exception during construction of EventSource Microsoft.Identity.Client: Unable to load DLL ‘advapi32.dll’: The specified module could not be found.

ERROR: Exception during construction of EventSource System.Collections.Concurrent.ConcurrentCollectionsEventSource: Unable to load DLL ‘advapi32.dll’: The specified module could not be found.

Additional context/ Logs / Screenshots The same method works good in if I build it in mono backend in Android The same method works good if I build it for UWP solutions

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
GeoKcommented, Jun 10, 2020

@bgavrilMS - Looks like Sha256Managed is not part of the Windows Platform FIPS-validated cryptographic algorithms: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.sha256managed.-ctor

1reaction
pocce90commented, Jun 9, 2020

If you say that the latest newtonsoft works with unity, then we can update our internal copy to latest as well.

Unfortunately Newtonsoft doesn’t want to make his libraries compatible with Unity. But there is a fork of Newtonsoft that works with unity and it’s updated to the latest version of newtonsoft (12.0). probably you will take only the fix that the fork do to solve the problem. https://github.com/jilleJr/Newtonsoft.Json-for-Unity

Here the core of the fork: This repo is a fork of JamesNK/Newtonsoft.Json containing custom builds for regular standalone, but more importantly AOT (Ahead Of Time) targets such as all IL2CPP builds (WebGL, iOS, Android, Windows, Mac OS X) and portable .NET (UWP, WP8).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug - Newtonsoft Json crashes the editor window
Hi all, My Unity editor consistently crashes while using the JsonConvert.SerializeObject method of "com.unity.nuget.newtonsoft-json" package.
Read more >
Newtonsoft.JSON package added, but getting namespace ...
I followed the suggestion and added: using Unity.Plastic.Newtonsoft.Json;. and the error disappeared within Visual Studio as expected. So far, ...
Read more >
Troubleshooting MSAL.NET in Unity applications
Cause and solution. The issue comes from Unity IL2CPP plugin. When optimizing code (using code stripping), it removes needed dependencies for ...
Read more >
Unity keeps putting some package in the package cache ...
So basically I have installed Json.Net for core 2.0 but unity keeps ... cache folder causing a duplicate error and breaking everything.
Read more >
[Resolve]-Unity 3D vs. UDK 3 for iOS - appsloveworld.com
I have a couple ideas for some 3D games/apps and need to know which 3D engine to go with. I like the high-level...
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