Tracking GitHub release download counts in a single-file WinForms app
A developer shared a small WinForms utility that totals GitHub release download counts across all their projects and keeps history over time. It compiles from a single C# 5 file with the csc.exe bundled in Windows, without Visual Studio. The write-up is useful for anyone tracking download trends or hitting GitHub API rate limits and TLS issues on .NET Framework 4.
Key points
- download_count only counts release assets; Download ZIP, git clone and Source code archives are not included.
- Anonymous GitHub API access is limited to 60 requests per hour; track X-RateLimit-Remaining and X-RateLimit-Reset headers.
- Traffic data needs a fine-grained token with Administration: Read-only permission.
- On .NET Framework 4, enable TLS 1.2 explicitly via ServicePointManager.SecurityProtocol with the value 3072.
- The token is encrypted with ProtectedData.Protect for the current Windows user and stored under HKCU.
- Build with csc.exe /target:winexe; JSON parsing uses JavaScriptSerializer from System.Web.Extensions.
A developer built a small Windows utility that totals download counts for GitHub release assets across all their repositories, a figure the GitHub web interface does not display. Because the API only returns current values, the tool saves a snapshot after each check, which enables weekly growth and trend views.
It targets .NET Framework 4 and C# 5 so a single file compiles with csc.exe bundled in Windows, with no Visual Studio or extra packages. The write-up covers practical pitfalls: enabling TLS 1.2 manually, handling the 60-requests-per-hour anonymous rate limit, storing the optional token encrypted with ProtectedData, and drawing dashboards on a custom Canvas.
Real-world use
- A maintainer of several open-source libraries who wants one dashboard for download totals and star growth.
- A team distributing a desktop tool that needs per-release download trends without Visual Studio on the build machine.
- Someone maintaining a legacy .NET Framework 4 project that must build with only the built-in csc.exe.
Why it matters
If you publish release binaries on GitHub, download_count gives a usable adoption signal, but the API only returns current totals, so you need to store snapshots yourself to see trends.
Related stories
- C# 14 extension members: the shadowing bug the compiler won't warn you aboutDEV Community: #csharp1 d ago
- LLM tokens measured in C#: why AI can't count the R's in strawberryDEV Community: #csharp2 d ago
- Collection Return Types in C#: Interfaces, Views, and SnapshotsNick Cosentino (Dev Leader)2 d ago