Preface
Edit debug DotNet The source code can be operated according to the official website tutorial , But because of network problems, there will be various problems of download failure , Here is a simple tutorial ( With 6 For version )
Download the source code
Download the source code GitHub Downloading the source code is extremely slow , Can be replaced by domestic warehouse https://github.com.cnpmjs.org/ or https://git.sdut.me/
Download the source code
git clone --recursive https://github.com/dotnet/aspnetcore
Download sub module ( This one may be too laggy, so you'd better modify it )
git submodule update --init --recursive
When the download is complete , Remember to change the address back , Because the first download is big , In the future, the download will be small
git tag View version
git checkout V6.0.3( Version needed )
modify nuget Configure delete section int package
Configuration environment
Set up Visual Studio
Different versions , The requirements are different , Set the environment according to different versions
- 1 - Script settings
According to oneself Visual Studio Version settings The default is Enterprise Preview
./eng/scripts/InstallVisualStudio.ps1 -Edition Professional -Channel Release
./eng/scripts/InstallVisualStudio.ps1 [-Edition {Enterprise|Community|Professional}] [-Channel {Release|Preview}]
- 2 - Manual settings
according to json File lookup configuration , according to Configuration table ( Here we use 2022 Subject to , according to vs Version of the configuration ) Find the specific items that need to be configured
Download and install NodeJS
Download and install the corresponding according to the version requirements NodeJS https://nodejs.org.
Download and install Yarn
npm install -g yarn
download java jdk
There is no script download here , Use Download from the official website
When the download is complete , Click next to install next. I won't talk about it in detail here , Add... To the environment variable after downloading JAVA_HOME Variable
Modify the source code configuration
Put... In the installation directory vswhere Put the file into the source code tool in , There is no folder to create. Note the version number , Because the file is large, the script download is too slow , So prepare in advance
Restore the source code
.\restore.cmd
The source code may get stuck for a while , don't move , After a while ( It may take a long time , wait ……) There will be messages such as download failure .
Use IIS Create application
Modify the profile address , Change to the local address we created
Next, use the command again restore
Go to any document you need Download on Microsoft's official website , After downloading, put it into the application you create , Re execution restore Until there are no errors
Source code compilation
The last step , You can use scripts (eng\build.cmd) Generate , It can also be opened Visual Studio Compile the generated