Requirements: When using ASP.NET Core to develop projects, you need to use various objects that have already been written, and sometimes you need to check the implementation of the source code for in-depth research, how to view the dotnet source code?
I used to open the GitHub website and search in the dotnet open source repository, you can refer to the following:
One of the disadvantages of using this method is that due to the domestic network environment problems,The opening speed is relatively slow, and the search still requires logging in, and the search is also relatively slow! Is there a better way to view the dotnet source code?
.NET Source Browser:The hyperlink login is visible.
Open the .NET Source Browser online website, you can search directly online, the search is more convenient and very fast, as follows:
You can also see all the locations where the keyword is used by double-clicking on it, as shown below:
The website is actually an online website generated by the SourceBrowser tool, and of course, you can also generate such a website from the source code of your own project.
SourceBrowser address:The hyperlink login is visible.
When indexing, use Roslyn to analyze the C# and VB source code and in the output directoryGenerate a large number of static hyperlinked HTML files。 There is no database. The website is primarily static HTML, in whichAll links, source code coloring, etc. are pre-calculated at index time。 All hyperlinks are hardwired as simple links that bypass the server.
The only component running on a web server is a service that looks up given a search query and returns a list of matching types and members, which are hyperlinks to static HTML. The Web service keeps a list of all declared types and members in memory, which is also pre-computed at index time. All services such as Find All References, Project Explorer, etc. are pre-rendered.
The generator is not incremental. You have to generate an empty folder from scratch every time, and then atomically replace the currently deployed folder with new content (e.g. deploy with Azure, robocopy /MIR to inetpub\wwwroot, etc.). For smaller projects, deploying to Azure using Dropbox or Git will do the trick.
SourceBrowser author wrote an example of generating an online website from their own source code with the following command:
Start the generated website with the following command:
The renderings are as follows:
SourceBrowser is designed to be highly scalable. it60 million lines of code can be easily processed(source code for all Microsoft development departments), andIt can be easily scaled to 100 million rows。 This means that there are currently about 6 million symbols (4 GB of RAM).
(End) |