2

I've installed the Microsoft.Identity.Client in Visual Studio and can now declare using Microsoft.Identity.Client; within the code. Visual Studio is happy. Unity, however, is not.

Assets\Scripts\AutoKhan.cs(8,17): error CS0234: The type or namespace name 'Identity' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

What must I do to make Unity similarly happy?

Zoe
  • 27,060
  • 21
  • 118
  • 148
CodeMonkey
  • 1,795
  • 3
  • 16
  • 46

1 Answers1

3

I have run into similar issues when using external libraries. Often there is a dll to add to your project because of how Unity compiles your project.

This may be useful. How to use an external dll

Skyler Lauren
  • 3,792
  • 3
  • 18
  • 30
  • 1
    Perfect. I found a Microsoft.Identity.Client.dll in C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.Developer.IdentityService and I added it to Assets/Plugins. Worked like a charm! – CodeMonkey Jun 05 '20 at 20:31
  • That was DEFINITELY not the right dll to copy! Haha. Instead, I had to follow the function which showed where it was located at the top of the file so I could copy THAT dll. It was at W:\\Packages\Microsoft.Identity.Client.4.14.0\lib\net45 which I still had to copy to Assets/Plugins to get Unity to see it. – CodeMonkey Jun 08 '20 at 18:30