The input of mdoc is dll
,winmd
or exe
which are organized in below folder structure.
|_dependencies
| |_version1
| |-A.dependent.dll
| |-B.dependent.dll
|_version1
|-A.dll
|_B.dll
In current production pipeline, not all the source repos have binaries in it. Some are the NuGet packages registered in csv file.
Example sources:
We may not always be able to use the source repo as the input so the best way is to download the pipeline artifact to local to debug.
There are 2 commands used in current production pipelines.
- fx-bootstrap: generate
frameworks.xml
to the output folder
fx-bootstrap -fx {frameworks output folder} -importContent {true/false}
- update: generate ECMAXMLs to the output folder
update -o {mdoc output folder} -fx {frameworks path} --debug -index false -lang docid -lang vb.net -lang fsharp -L "C:\Program Files (x86)\Windows Kits\10\References" -L "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\msdatasrc.dll" -L "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\PublicAssemblies" -L "C:\Program Files\dotnet" --delete
- Clone https://github.com/mono/api-doc-tools repo to local.
- Open it in Visual Studio and make sure it is built successfully.
- Set
mdoc
as the startup project. - Prepare the input folder in local disk.
- Create two launch profiles, one for
fx-bootstrap
and one forupdate
. - Locate the problematic piece of code.
- Set a breakpoint and start to debug.
- Partner reported a bug: https://ceapex.visualstudio.com/Engineering/_workitems/edit/896871
- Analysis the bug and identify this is a mdoc issue.
- Located the impacted .NET content repo: dotnet-api-docs.
- Find the corresponding pipeline in the commit log. https://apidrop.visualstudio.com/Content%20CI/_build/results?buildId=422059&view=results
- Since the source is not NuGet source, we can pull the source repo as our input.
- Go to
Run .NET CI Script
step and find the source repo in theparamsJson
"https://apidrop.visualstudio.com/_git/binaries","branch":"master","folder":"dotnet"
- Clone the source repo to local.
- Select
fx-bootstrap
launch profile and run.
fx-bootstrap -fx "{local path}\binaries\dotnet"
- The entry class of mdoc is mdoc.cs and the update command is in MDocUpdater.cs.
- After analyzing the bug, you may want to set a breakpoint at:
- Select
update
launch profile and start to debug.
-
If you want to debug against a specific .dll, you can modify this line of MDocUpdater.cs
From
var assemblyFiles = filters.Split('|').SelectMany(v => Directory.GetFiles(path, v));
To
var assemblyFiles = filters.Split('|').SelectMany(v => Directory.GetFiles(path, v)).Where(x => x.Contains("name-of-dll"));