In the Windows System Restore to construct ASP.NET Core Source

  Hello everyone, these days try to pull AspNetCore source code from Github, tried to open by Visual Studio, but did unsatisfactory. We need to build the source code we got me, so that it can be restored VisualStudio project through. After all, AspNetCore is a huge set of items.

prerequisites

  Construction of AspNetCore source in Windows requires the following hardware requirements.

  • Windows 10 version 1803 or later
  • At least 10 GB of disk space and a good network (our build tools and scripts to download a lot of dependencies)
  • Visual Studio 2019 (C ++ required because some runtime library, even if you have Windows Visual Studio prerequisites, you sometimes do not check the C ++ runtime library, etc., so we still have to run, probably over four G)
    • To install the required precise component, run . / ENG / scripts /InstallVisualStudio.ps1
      PS> ./eng/scripts/InstallVisualStudio.ps1
  • Git tools
  • NodeJS. 10.14.2 LTS version or later https://nodejs.org
  • Java Development Kit 11 or later. Either:
  • Chrome- based on selenium need to install a test version of Chrome. From [  to https://www.google.com/chrome  ]  download and install it

Pulling Code

ASP.NET Core using git sub-module contains the source code to a number of other projects.

For a copy of the new project, run:

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

If you do not pass the first time, you can then update, then  \ restore.cmd.  :

git submodule update --init --recursive

In order to manage the future, you can choose iteration, switches and create a branch.

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

Restore Code

After pulling Github code, you need to do the following, it will download the tools you need to store and restore the entire time.

.\restore.cmd

This time, you should be able to open the project you want to open by Visual Studio or Vs Code, but after opening'll find that many lack the required project itself dependent libraries.

Building codes

The premise is that you build the code of the code by the reduction. Otherwise, it will directly build fails, where the Windows command line is as follows:

.\build.cmd

This operation will delay you a little time, taking into account the general computer, almost a little more than ten minutes will be used, of course, it is in a good situation for your network.

Enjoy the food through Visual Studio

 some problems

   像NodeJs 和 Java JDK 一定要装好,最好在PowerShell执行以上操作。

问题一:

  PowelShell出现 无法加载文件 ******.ps1,因为在此系统中禁止执行脚本。有关详细信息,请参阅 "get-help about_signing" ,请在powershell中执行  set-ExecutionPolicy RemoteSigned .

问题二:

  如果找不到SDK,请启动Visual Studio,转到“ 工具”>“选项”,然后在“ 环境”>“预览功能”选中“ 使用.NET Core SDK的预览”

最后希望大家顺利还原并构建源代码!~

更多资料

  https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md

Guess you like

Origin www.cnblogs.com/ZaraNet/p/12001261.html