Skip to content

Build and Test

Bogdan Gavril edited this page Jun 30, 2023 · 24 revisions

Prerequisites to Build MSAL.NET

Prerequisites to build MSAL.NET can be found here

Fast build

MSAL .Net supports MANY target frameworks, by default it does not enable the mobile targets and the legacy targets. Unit tests will run with these.

To load all targets, open this file and comment in the targets you are interested in.

To get MSAL to build for all the frameworks, you'll need a hefty Visual Studio 2019 installation plus several Windows SDKs.

Note: Do not use VS Code or VS for Mac as it is not able to understand and layout this project correctly.

Build

Load LibsAndSamples.sln for a bigger solution with lots of apps that exercise MSAL. Load LibsNoSamples.sln for a small solution that has the library and the tests.

Note: if you run into strong name validation issues, please log a bug. Workaround is to disable it on your dev box by running Admin Dev Prompt > sn -Vr *

Run tests

You won't be able to run the Integration test or Automation tests because they require access to a Microsoft KeyVault which is locked down. These tests will run as part of our DevOps pipelines though.

Microsoft contributors can run integration tests by following instructions [here](https://microsoft.sharepoint.com/teams/ADAL/_layouts/OneNote.aspx?id=%2Fteams%2FADAL%2FSiteAssets%2FDevEx%20Notebook&wd=target%28ID4S%2FMSAL.NET%2FTechnical%2FTesting.one%7C267ED97C-4551-49B4-B9C4-BA1239EC9C9F%2FMSAL%20desktop%20integration%20tests%7CF69C92B6-4A10-404A-9E9E-0FE513BF2897%2F%29 onenote:https://microsoft.sharepoint.com/teams/ADAL/SiteAssets/DevEx%20Notebook/ID4S/MSAL.NET/Technical/Testing.one#MSAL%20desktop%20integration%20tests&section-id={267ED97C-4551-49B4-B9C4-BA1239EC9C9F}&page-id={F69C92B6-4A10-404A-9E9E-0FE513BF2897}&end).

Package

To test an MSAL package, use the package command from VS. Or from the command line:

msbuild <msal>.csproj /t:pack /p:MsalClientSemVer=1.2.3-preview

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