Skip to content

Build and Test

Bogdan Gavril edited this page Jan 23, 2019 · 24 revisions

Visual Studio 2017 installation

Make sure you install VS with the following workloads:

  • .Net Desktop Development
  • Universal Windows Platform Development
  • Mobile Development with .Net
  • .Net Core cross-platform development

Some of the sample apps will require extra components, such as Windows SDKs, .Net Framework SDKs etc. You can either ignore those projects (unload them) or follow the instructions / error messages to install the extra components.

Visual Studio for Mac

MSAL is a multi-target library and at the time of writing, VS for Mac is not able to understand and layout this project correctly. You can still build from the command line.

Build

  1. 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.
  2. Build in VS or via the command line with "msbuild /t:restore" and "msbuild"

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.

Run the unit tests from the assemblies:

  • Microsoft.Identity.Test.Unit.net45
  • Microsoft.Identity.Test.Unit.netcore

Package

From VS or from the command line if you wish to control the versioning:

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

Command Line

MSAL is a multi-target library. To enable us to target Xamarin as well as .Net core, we took a dependency on the MsBuild SDK extras - https://github.com/onovotny/MSBuildSdkExtras

Unfortunately dotnet commands do not work with MSBuildExtras, except dotnet test. However, dotnet restore and dotnet build don't do much except shelling out msbuild, so please use msbuild /t:restore and msbuild if you wish to build from the command line.

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