Library / SDK
JeffreySu/WeiXinMPSDK avatar
JeffreySu/WeiXinMPSDK

Senparc.Weixin: a .NET SDK that covers every WeChat platform from one codebase

WeChat SDK for C# (Senparc.Weixin for C#), supporting .NET Framework, .NET Core and .NET 10.0. Covers WeChat official accounts, mini programs, mini games, WeChat Pay, WeCom/enterprise accounts, the Open Platform, JSSDK and other WeChat services across the full platform.

8,923 stars4,333 forksC#Apache-2.0

At a glance

What is it?
Senparc.Weixin wraps official accounts, mini programs, mini games, WeChat Pay, WeCom, the open platform and JSSDK behind one set of NuGet packages, with middleware for ASP.NET Core. The pitch is breadth and a long release history; the cost is a large surface area and documentation that lives mostly in Chinese.
Who is it for?
Adopt Senparc.Weixin if your service is already .NET and you need several WeChat surfaces, because the module packages share registration and call patterns and the repository ships runnable samples under Samples/. Do not adopt it if you need only one narrow endpoint such as a single TenPayV3 callback, where calling the HTTP API directly keeps the dependency list shorter.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 21 days ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • JeffreySu/WeiXinMPSDK8,923 ★ · +25
Star history
Repository2026-09-222026-11-14
JeffreySu/WeiXinMPSDK8.9k8.9k

25 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What Senparc.Weixin covers, and who ends up using it

The repository describes itself as a WeChat SDK for C# that spans official accounts, mini programs, mini games, WeChat Pay, WeCom (the former enterprise account), the open platform, JSSDK and WeChat hardware or Bluetooth peripherals. That list is the product. If your team writes .NET and your product has to talk to more than one WeChat surface, the value is that the module packages share naming, registration and call conventions, so learning one module carries over to the next. The README states this directly: the configuration, registration and interface call methods in the samples are consistent, and learning one module lets you extend to the others.

The audience is therefore fairly specific. It is a .NET shop that already has a WeChat integration requirement and does not want to hand-roll signature computation, access token refresh, message decryption and the XML or JSON envelope for each platform separately. The README also notes that the demo projects double as material for people learning .NET, which tells you something about how the samples are written: they are teaching artifacts, not minimal production templates.

One thing the README leans on heavily is the project's age. It says the project has been maintained for more than 13 years, and the release history backs up the cadence rather than the claim: 2025.12.02, then 2026.6.8, then 2026.8.7. The last push to the default branch was on 2026-10-24, so the repository is current. Treat the longevity as a signal about continuity, not as a quality score.

How the module packages and middleware fit together

The architecture is a set of NuGet packages layered by platform rather than one monolithic assembly. A base package, Senparc.Weixin, carries shared types. Platform packages sit on top: Senparc.Weixin.MP for official accounts, Senparc.Weixin.WxOpen for mini programs, Senparc.Weixin.Work for WeCom, Senparc.Weixin.Open for the open platform, and Senparc.Weixin.TenPay plus Senparc.Weixin.TenPayV3 for payments. There is also a Senparc.Weixin.All meta-package for pulling the set together.

Integration into ASP.NET Core goes through middleware packages rather than manual routing. The README lists Senparc.Weixin.MP.Middleware, Senparc.Weixin.WxOpen.Middleware and Senparc.Weixin.Work.Middleware alongside the plain platform packages. There is also Senparc.Weixin.AspNet and a separate Senparc.WebSocket package.

The design decision worth noticing is that state lives behind a cache abstraction. Packages exist for Redis (Senparc.Weixin.Cache.Redis and Senparc.Weixin.Cache.CsRedis), Memcached (Senparc.Weixin.Cache.Memcached) and Dapr (Senparc.Weixin.Cache.Dapr). Access tokens are the reason. WeChat issues tokens with a lifetime and a request budget, so a single-process in-memory store breaks the moment you scale to two instances. Making the cache pluggable is the right call for a multi-node deployment, and it is also the part most likely to be misconfigured, because a wrong cache choice shows up as intermittent token errors rather than a clean failure at startup.

Installing Senparc.Weixin and registering an official account handler

The README points at module-specific documentation and runnable samples rather than a single install walkthrough. The pattern it describes is the same across modules: add the package, configure your WeChat parameters, register the middleware, then handle incoming messages. The README says the samples need only the WeChat parameters configured and no code changes.

The packages are published on NuGet under the names the README lists, so the official account route starts with Senparc.Weixin.MP for the platform code and Senparc.Weixin.MP.Middleware for the ASP.NET Core pipeline integration. Add them through your usual NuGet workflow; the README's Hello World then registers services with builder.Services.AddSenparcWeixinServices(builder.Configuration) and enables them with app.UseSenparcWeixin(...), calling register.RegisterMpAccount for each official account, and the module documentation is at https://sdk.weixin.senparc.com/Docs/MP/.

The repository keeps its runnable examples under Samples/, split into All, MP, TenPayV2, TenPayV3, Work and WxOpen, with shared code in Samples/Shared/. The README points at the .NET 10 sample in Samples/All/net10-mvc/ and notes it is backward compatible. The fastest first use is to open that sample, fill in your own WeChat parameters, and point the WeChat platform's server URL at it. What you should see is the sample responding to WeChat's verification request; if it does not, the parameters are the first thing to check. The repository also provides Samples/sample-publish.bat and Samples/deploy-sample-net8.ps1 as publish and deployment helpers for the sample projects.

Where the SDK gets in the way

The largest practical limitation is documentation language. The README, the module documentation links and the announcement blocks are in Chinese. There is an English readme (readme.en.md) and an English version link, but the per-module documentation the README points to is the Chinese site. For a team without Chinese readers, that turns every non-obvious error into a search exercise against a codebase you did not write.

The second is version sprawl. The README claims support from .NET 3.5 and 4.0 through .NET Standard 2.x, .NET Core 2.x and 3.x, and .NET 6.0, 7.0, 8.0 and 10.0. Supporting that range is a real engineering cost.

Third, the surface area is genuinely large. The repository lists packages for payments in two generations, with the README marking TenPayV3 as recommended and TenPayV2 as not recommended. Picking the wrong one is easy if you skim the package list. There is also a separate Senparc.AI effort mentioned in the README with samples still being rolled out, so any AI-related integration should be treated as in progress rather than settled.

Finally, the samples are teaching material. They are useful for getting a handler running, and they are not a template for how to structure a production service. Expect to reorganize.

When a thin HTTP client beats a full platform SDK

The realistic alternative is not another .NET WeChat SDK; it is calling the WeChat HTTP APIs directly from your own small client, with a library such as Flurl or plain HttpClient, plus your own token cache. The difference in approach is scope. Senparc.Weixin gives you typed models, message decryption, signature validation and a middleware pipeline for every platform it supports. A hand-rolled client gives you exactly the endpoints you call and nothing else.

That trade favours the hand-rolled route in a few concrete cases. If you only need WeChat Pay V3 notifications verified and acknowledged, the surface is a signature check and a JSON body, and you can write it in a few hundred lines you fully understand. If your team is not on .NET at all, the SDK is irrelevant regardless of its quality. And if you need to pin behaviour to a specific API revision because WeChat changed something, owning the client means you are not waiting on a package release.

The trade favours the SDK when you need several platforms at once. Message handling for official accounts involves signature verification, XML or JSON parsing depending on the encryption mode, and reply construction with a time limit. Reimplementing that per platform is the kind of work that looks small until the third platform. The middleware packages also matter if you want the WeChat endpoint to sit inside your existing ASP.NET Core pipeline rather than beside it.

Maintenance, licensing and what a version bump costs you

The release cadence is visible in the tags: 2025.12.02 in December 2025, 2026.6.8 in June 2026, and 2026.8.7 in August 2026. The last push to master was on 2026-10-24. That is a project that ships a few releases a year, which matters because WeChat itself changes endpoints and deprecates older payment flows. A dormant SDK would leave you stranded; this one does not appear to be.

Upgrade cost is dominated by the version naming. Releases are tagged by date (2026.8.7), not by semantic version, so you cannot read breaking-change risk off the version number. Read the release notes before bumping. The two payment generations are a separate axis: TenPayV2 and TenPayV3 are distinct packages, and the README marks V2 as not recommended, so a migration between them is a code change, not a package swap.

The licence is Apache-2.0, confirmed by the license badge and the license.md file at the repository root. Apache-2.0 permits commercial use and modification and includes an express patent grant, which is generally the permissive option enterprises prefer. It also requires that you preserve the licence and notice files and state significant changes. This is a description of the licence text, not legal advice; have your own counsel review it if the integration is material to your product.

Editorial conclusion

Adopt Senparc.Weixin if your service is already .NET and you need several WeChat surfaces, because the module packages share registration and call patterns and the repository ships runnable samples under Samples/. Do not adopt it if you need only one narrow endpoint such as a single TenPayV3 callback, where calling the HTTP API directly keeps the dependency list shorter. Before committing, verify that the module package matching your platform is published on NuGet at the version you need, and confirm the sample project for your target framework builds in your own solution.

Frequently asked questions

What does Senparc.Weixin actually do?

It is a C# SDK that wraps the WeChat platform APIs, covering official accounts, mini programs, mini games, WeChat Pay, WeCom, the open platform, JSSDK and WeChat hardware. It ships as separate NuGet packages per platform plus middleware packages for ASP.NET Core.

Which .NET versions does Senparc.Weixin support?

The README states support for .NET 3.5, 4.0, 4.5, .NET Standard 2.x, .NET Core 2.x and 3.x, and .NET 6.0, 7.0, 8.0 and 10.0. It also says the SDK is compatible with MVC, Razor, WebApi, console, desktop, Blazor, MAUI and background service hosts.

How do I install Senparc.Weixin in a .NET project?

Add the package for your platform from NuGet, for example Senparc.Weixin.MP for official accounts, together with the matching middleware package such as Senparc.Weixin.MP.Middleware. The README says the samples then need only your WeChat parameters configured, with no code changes.

Does Senparc.Weixin work with Redis or Memcached for token storage?

Yes. The repository publishes Senparc.Weixin.Cache.Redis, Senparc.Weixin.Cache.CsRedis, Senparc.Weixin.Cache.Memcached and Senparc.Weixin.Cache.Dapr as separate packages, which lets access token state live outside a single process.

Which WeChat Pay package should I use, TenPayV2 or TenPayV3?

The README marks WeChat Pay V3 as recommended and V2 as not recommended, and lists Senparc.Weixin.TenPayV3 as its own NuGet package. They are separate packages, so moving between them is a code change rather than a version bump.

Official sources

  1. JeffreySu/WeiXinMPSDK on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/jeffreysu-weixinmpsdk.svg)](https://hysenlabs.com/projects/jeffreysu-weixinmpsdk)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/jeffreysu-weixinmpsdk.svg)](https://hysenlabs.com/projects/jeffreysu-weixinmpsdk)

Was this useful?