Enable Github "Used by" button on .Net Projects
Github has a fantastic new feature which can show public projects that reference your Nuget Package. This is a very useful tool to understand how your consumers are using your package.
Unfortunately, for most .Net projects on Github, this feature doesn't work. An issue on Github encouraged me to finally look into how this feature worked. Their documentation linked here suggest that the key is in the csproj files. I hopped on the awesome-dotnet-core repo, where I found the links of a number of projects that had this feature working. I compared the csproj files in the working projects to my own and found the required components.
Required Components:
- Nuget Package
- csproj entries
Firstly, your project must be publishing a Nuget Package. My blog covers publishing Nuget packages here.
Secondly, there are two required entries in the csproj file that make this feature work:
- PackageId
- RepositoryUrl
PackageId should be the same as your Nuget Package Title. RepositoryUrl should be the url of your Git Repo.
Once your csproj is updated, push the changes to master, within 30 mins, the "Used by" button should appear.
Enjoy!