Hello everyone, these days I tried to pull the source code of AspNetCore from Github and tried to open it through Visual Studio, but it was not satisfactory. We need to build the source code we pulled so that we can restore the project through VisualStudio. After all, AspNetCore is a huge project set.


The requirements for building the AspNetCore source code in Windows have the following hardware requirements.

  • Windows 10 version 1803 or higher
  • At least 10 GB of disk space and good network (our build script downloads many tools and dependencies)
  • Visual Studio 2019 (Because some C ++ runtime libraries are required, even if you have prerequisite Visual Studio in Windows, you sometimes do not check C ++ and other runtime libraries, so we still have to run, about four more G
    • To install the required precise component, run . / ENG / scripts /InstallVisualStudio.ps1
      PS >. / ENG / scripts /InstallVisualStudio.ps1
  • Git tools
  • NodeJS. LTS version 10.14.2 or higher
  • Java Development Kit 11 or higher. Either:
  • Chrome-Selenium-based testing requires a version of Chrome. Download and install it from [ 


Pull code

ASP.NET Core uses git submodules to contain the source code of some other projects.

For a new copy of the project, run:

git clone --recursive https: // github.com/aspnet/AspNetCore

If it doesn’t pass the first time, you can update it again, then  . \ Restore.cmd  :

git submodule update --init --recursive

For future management, you can choose to iterate, switch and create a branch.

git checkout (version to use) v3. 1.0 -b test

Restore code

After Github pulls the code, you need to do the following, which will download the required tools and restore the entire repository once.

. \ restore.cmd

At this time, you should be able to open the project you want to open through Visual Studio or Vs Code, but after opening, you will find that many of the dependent libraries required by your project are missing.

Build code

The premise of building code is that your restore code passes. Otherwise, the build will fail directly. The Windows command line is as follows:

. \ build.cmd

This operation will delay you a little time. Considering the general computer, it will take more than ten minutes. Of course, this is under the condition of good network.

Enjoy food with Visual Studio



 some problems

Like NodeJs and Java JDK must be installed, it is best to perform the above operations in PowerShell.

Question one:

PowelShell appears unable to load the file ******. Ps1  because script execution is prohibited in this system. For more information, see ” get-help about_signing ” .  Please execute set -ExecutionPolicy RemoteSigned in powershell    .

Question two:

If you can not find the SDK, start Visual Studio, go to ”  Tools”> “Options”, then in the ”  environment”> “preview” under the select ”  Use of .NET Core SDK Preview” .

Finally, I hope everyone can successfully restore and build the source code! ~

more info


Orignal link:https://www.cnblogs.com/ZaraNet/p/12001261.html