In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to compile dotnet and aspnetcore source code, the article is very detailed, has a certain reference value, interested friends must read it!
0. Environmental preparation
For details, see "Step 2: Install pre-requisites" in the official document: "compiling ASP.NET Core with source code".
My machine only comes with Visual Studio 2022 Jet JDK and NodeJS in advance.
You can install it on your own.
1. Restore the repository
As described by BuildFromSource.md, enter the directory where the code is located in the command line window and enter the following command to start restoring the repository:
Restore.cmd
After waiting for a little, I encountered the first mistake:
This looks like the download timed out, the damn network!
two。 Do one thing under cover of another
Find the file .dotnet\ dotnet-install.ps1 where the download command is located, and find that the logic of the code is complex and difficult to modify.
However, on second thought, since the remote download is slow, it would be better to download it locally instead!
According to the download link reported wrong above, find the code to get the download address:
Function Get-Feeds-To-Use () {$feeds = @ ("https://dotnetcli.azureedge.net/dotnet"," https://dotnetbuilds.azureedge.net/public") if (- not [string]:: IsNullOrEmpty ($AzureFeed)) {$feeds = @ ($AzureFeed)} if ($NoCdn) {$feeds = @ ("https://dotnetcli.blob.core.windows.net/dotnet"," "https://dotnetbuilds.blob.core.windows.net/public") if (- not [string]:: IsNullOrEmpty ($UncachedFeed)) {$feeds = @ ($UncachedFeed)}} return $feeds}
Modified to download locally:
Function Get-Feeds-To-Use () {$feeds = @ ("http://localhost:12345/dotnet") return $feeds}"
For now, you just need to create an IIS site locally and terminate the program after each error.
Then according to the error link, use the download tool to download the original link, place it in the corresponding directory of the local site, and then run restore.cmd again.
Complain: one of the files went down for four hours. Embarrassed rz
3. Get the submodule source code
After many retries, all of them were downloaded successfully.
However, another error is shown:
Referring to BuildFromSource.md, we found that we lost the parameter recursive when we clone:
Git clone-- recursive https://github.com/YOUR_USERNAME/aspnetcore
Fortunately, it can be remedied:
Git submodule update-init-recursive
Rerunning restore.cmd completed successfully.
4. Compile
However, when we use VS2022 to compile any of dotnet/aspnetcore 's projects, we are prompted that the specified SDK cannot be found:
It turns out it's looking for SDK 7.0:
"sdk": {"version": "7.0.100-preview.2.22103.2"}
This SDK is actually installed in the source directory in the previous step.
Therefore, you only need to add the SDK path under the source directory, such as E:\ Codes\ aspnetcore\ .dotnet\ sdk, to the PATH environment variable.
5. test
However, when we ran the test, we were prompted that the test case could not be found.
According to the error prompt:
Run the test again successfully.
The above is all the contents of the article "how to compile dotnet and aspnetcore source code". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.