How to run and compile the source code of .NetCore?
As .net developers, in order to code better, we must know what is happening and why. Understanding the source code of .netcore is our basic quality✊
Source code address
.NET Platform (github.com) This is the source code address of .net open source on github
aspnetcore This is the source code address of .netcore
runtime This is the source code address of the runtime. Some .netcore source codes will depend on this runtime (download it when needed)
Build method
There are a few things you need to pay attention to when building:
- It takes time to build, you can touch it 🐟;
- At the same time, building requires access to github, that is, using magic🥳! ! ! ! ! !
- In addition, the minimum version of Visual Studio is 2019, and basic packages including the window platform development kit are installed;
- The generation may throw an error, ignore it and just run the test project
In the github source code readme.md file, you can see this sentence of building asp.net core Click to enter the source code;
Download code git clone --recursive https://github.com/YOUR_USERNAME/aspnetcore
powershell execution script Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Execute ./restore.cmd
in the project root directory
Execute .\build.cmd -Configuration Release
in the subproject root directory
Run and OK
Check different class libraries according to our needs. There will be a sample example corresponding to it. Just add a breakpoint and run it!