Skip to content

hololens2

pmaytak edited this page Feb 12, 2021 · 6 revisions

Using MSAL.NET with Unity IL2CPP (including HoloLens 2)

Unity IL2CPP scripting backend performs code optimization by doing code stripping - removing code and dependencies which it thinks are unused. This creates an issue when your code uses reflection. The code stripping tool cannot always detect those classes or members that are used with reflection. One recommended solution is to add the following assemblies to the Assets/Links.xml in your project:

<assembly fullname="System" preserve="all" />
<assembly fullname="System.Core" preserve="all" />

Unity Manual - Managed code stripping page has more detailed information about this behavior. See [Bug] HoloLens 2 device code flow does not work #2231 for additional information and discussion.

Getting started with MSAL.NET

Acquiring tokens

Web Apps / Web APIs / daemon apps

Desktop/Mobile apps

Advanced topics

FAQ

Other resources

Clone this wiki locally