Full Series links can be found here.

The development of ASP.NET Core is all done in the open on Github and seeing new functionality coming for up coming versions is pretty cool. It also made me curious how to run it locally without the released corresponding versions of the runtime etc.

The ASP.NET Core WebHooks project peaked my interest the other day and I thought this would be the opportunity to investigate.

To start with you have to have the code locally. This can be easily done with the git clone command.

git clone https://github.com/aspnet/WebHooks

You will get the following output:

C:\src\github\aspnet>git clone https://github.com/aspnet/WebHooks
Cloning into 'WebHooks'...
remote: Counting objects: 6325, done.
remote: Compressing objects: 100% (157/157), done.
remote: Total 6325 (delta 127), reused 150 (delta 81), pack-reused 6086
Receiving objects: 100% (6325/6325), 2.16 MiB | 943.00 KiB/s, done.
Resolving deltas: 100% (4362/4362), done.

Once the repository is cloned you change directory into the newly cloned repository and run .\build.cmd. It is that simple! It can take a little while but it is that simple.

What does it do? This is the interesting part. Looking at the initial command line output tells us some interesting bits of information.

C:\src\Github\aspnet\WebHooks [dev ≡]> .\build.cmd
Downloading KoreBuild 2.1.0-preview2-15698
Using KoreBuild 2.1.0-preview2-15698
WARNING: dotnet found on the system PATH is 'C:\Program Files\dotnet\dotnet.exe' but KoreBuild will use
'C:\Users\Adam\.dotnet\x64\dotnet.exe'.
WARNING: Adding 'C:\Users\Adam\.dotnet\x64' to system PATH permanently may be required for applications like Visual
Studio or VS Code to work correctly.
Adding C:\Users\Adam\.dotnet\x64 to PATH
.NET Core runtime 2.0.5 is already installed. Skipping installation.
dotnet-install: Downloading link: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008044/dotnet-sdk-2.1.300-
preview2-008044-win-x64.zip
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008044/dotnet-sdk-2.1.30
0-preview2-008044-win-x64.zip
dotnet-install: Adding to current process PATH: "C:\Users\Adam\.dotnet\x64\". Note: This change will not be visible if P
owerShell was run as a child process.
dotnet-install: Installation finished
>>> dotnet.exe msbuild @C:\Src\Github\aspnet\WebHooks\artifacts\logs\msbuild.rsp @C:\Src\Github\aspnet\WebHooks\artifact
s\logs\msbuild.logger.rsp

It downloads the latest KoreBuild that is specified in the repository in the korebuild-lock.txt file. This is used inside the run.ps1 file. This builder, with a ‘K’ to fit in with the naming conventions that the ASP.NET Core team use eg. Kestrel, is the mechanism from which the latest preview dotnet sdk is downloaded and installed with.

Once it’s downloaded and installed it proceeds to restore all the preview packages which the projects rely on, builds all the projects and runs all the unit tests with the following Test Plan:

   Test plan:
    - UnitTests/netcoreapp2.1
      - Microsoft.AspNetCore.WebHooks.shared.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Slack.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Stripe.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Trello.Test
    - UnitTests/netcoreapp2.0
      - Microsoft.AspNetCore.WebHooks.shared.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Slack.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Stripe.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Trello.Test
    - UnitTests/net461
      - Microsoft.AspNetCore.WebHooks.shared.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Slack.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Stripe.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Test
      - Microsoft.AspNetCore.WebHooks.Receivers.Trello.Test

The unit tests are run under 3 different Target Framework Moniker (TFM) which implement .NET Standard 2.0 to make sure each target implementation work as expected.

Once the tests are complete, and successful, it also builds all the .nupkg files for the nuget packages which is quite cool.

This brief investigation into an actively developed repository by the ASP.NET Core team has been really interesting and I hope to continue to drive deeper in the future.

Any questions/comments then please contact me on Twitter @WestDiscGolf