This repo contains the code for building http://source.dot.net
This repo uses https://github.com/KirillOsenkov/SourceBrowser (with a few additions here https://github.com/dotnet/SourceBrowser/tree/source-indexer) to index the dotnet sources and produce a navigatable and searchable website containing the full source code. This includes code from the runtime, winforms, wpf, aspnetcore, and msbuild, among others. For a full list see here https://github.com/dotnet/source-indexer/blob/main/src/index/repositories.props.
The build requires .NET 8.0 and Visual Studio 2022 to build.
The build will only work on windows because the source indexer executable is a .net framework executable.
git clone https://github.com/dotnet/source-indexer.git
- For each *.sln file
dotnet restore
- Find VS 2022 msbuild.exe on your machine, typically found at
C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe
msbuild build.proj
After the build is finished the index will exist in bin\index
and can be run by running dotnet Microsoft.SourceBrowser.SourceIndexServer.dll
in that folder. The index will be served on http://localhost:5000
The index is deployed by the VSTS build to the netsourceindex azure app service, with the index data stored in the netsourceindex storage account. The deployment does the following things.
- Split the generated index from the binaries and static data for the website.
- Upload the generated index into a new container in the netsourceindex storage account.
- Deploy the binaries and static data to the staging slot of the app service.
- Update the app service settings with the url of the storage container the index data was uploaded to
- Restart the app service
- Test the application by performing a GET of the url, fail if it doesn't return 200 OK
- Swap the staging slot into production for the app service
- Delete storage containers that haven't been used by the app service in the last 10 builds.
https://source.dot.net is monitored using availability tests from the dotnet-eng application insights resource. Alerting is handled through grafana here https://dotnet-eng-grafana.westus2.cloudapp.azure.com/d/arcadeAvailability/service-availability?orgId=1&refresh=30s