Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

ADAL .NET Build & Run

henrikm edited this page May 21, 2018 · 35 revisions

This is documentation about how to build an run the project. I wrote this because I had a lot of problems building the project (it is not the obvious build an run in visual studio) and I would figure that somebody else would have the same problems.

Before you build and run you will need a set of SDK's and tools installed on your box. You can see the pre-requisites here

Please click here to view the the Visual Studio 2017 required components.

Build ADAL/MSAL (Branch: dev)

To build for targets for Windows 8.1 for the following target platforms ARM, x86 and x64 you'll need VS2015 (latest update). See also prerequisites for additional details.

  1. Open the VS2015 Developer Command Prompt and navigate to the folder where you have the GitHub project.
  2. Start the build using the buildVS2015.cmd script.

To build targets for Xamarin Android (MonoAnroid7), Xamarin iOS (Xamarin.iOS10), Windows (net45), UWP (win81, netstandard1.1;netstandard1.3) you will need VS2017 (latest update). See also prerequisites for additional details.

  1. Open the VS2017 Developer Command Prompt and navigate to the folder where you have the GitHub project.
  2. Restore packages using the restore.cmd script.
  3. Build using the buildVS2017.cmd script. (This only builds the core components and the unit tests)
  4. To build everything run the buildAll.cmd script (This script also does the strongnaming required to run and build the unit tests and the sample apps)
  5. You can run the strongname.cmd to ensure you have strong naming disabled for your dev box. This is required to run tests and sample apps with bits that are not signed.

Build ADAL (Branch: adalv3/dev)

  1. First open the Developer command prompt as administrator
  2. Change the branch to adalv3/dev
  3. Run the following command: msbuild Adal.net.nowinrt.sln /t:restore /p:configuration=release - this will restore the nuget packages needed for the project.
  4. Now run msbuild Adal.net.nowinrt.sln /t:build /p:configuration=release - this will build the project.
  5. Then you can build it inside visual studio no problems.

I got all the info from the following issue.

Run ADAL

When you try to run the project, you will get the following exception: System.IO.FileLoadException: 'Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)'

To fix this follow these steps

  1. First open the Developer command prompt as administrator
  2. Go to the bin/debug folder of the selected test project.
  3. Run the following command to fix this dll issue: sn.exe -Vr Microsoft.IdentityModel.Clients.ActiveDirectory.dll
  4. Now you can run the project!

I got all the info from the following issue.

Clone this wiki locally