I noticed that Azure's Dotnet SDK repository has a file with a list of the whole public API (types/methods/etc) of the library. I assume this is generated using some tool. How can I generate this for my Dotnet library (written in C#)?
Asked
Active
Viewed 170 times
1 Answers
1
Based on the commit that last changed that file, it looks like they're using a library called Microsoft.DotNet.GenAPI
, which it looks like comes from the dotnet/arcade repository.
I suspect this is probably very closely related to the Microsoft.DotNet.BuildTools.GenAPI package that's available on NuGet.

StriplingWarrior
- 151,543
- 27
- 246
- 315
-
It seems like this can not be installed in a Dotnet Standard project. Are there any similar tools that work with a Dotnet Standard project? – m3h Jan 17 '20 at 20:33
-
I don't know, and before you get too far down that road I'd first ask what your requirements are, really? That C# file is an interesting and concise way to represent an API, but it has no documentation. Most people use [xmldoc](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/) comments to document their API. That [can be made](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/how-to-use-the-xml-documentation-features) to publish an xml file alongside your dll, which will allow IDEs to show the API and documentation inline. – StriplingWarrior Jan 17 '20 at 20:49
-
XML Documentation [can also be used](https://stackoverflow.com/q/15316381/120955) to generate HTML documentation for your API, which will probably be nicer than a bare-bones C# file for anyone who's not using an IDE to look at your API. – StriplingWarrior Jan 17 '20 at 20:50
-
I want to enforce that a library does not introduce any breaking changes in a release accidentally. For this, I need a way to compare the public API of the library with with the previous version's API. Another goal is to detect API changes in the library from a CI environment and prevent accidental breaking changes from being released. – m3h Jan 17 '20 at 21:32
-
For Java, I use [japicmp](https://github.com/siom79/japicmp) to do this. I am looking for an equivalent tool for the Dotnet environment. – m3h Jan 17 '20 at 21:36
-
1It would probably also be relatively easy to write your own tool, especially if having compilable C# as your output isn't one of your goals. It [looks like](https://www.ndepend.com/default-rules/NDepend-Rules-Explorer.html?ruleid=ND1500#!) NDepend also has some features that might help, if you're willing to go for a commercial product. – StriplingWarrior Jan 18 '20 at 23:51