JeffreySu/WeiXinMPSDK
44.5
Weak · 23 September 2026
278.6k
lines of production code
C#
with JavaScript
3
measurements over time
What this system is
This system is a comprehensive .NET SDK for integrating with the WeChat ecosystem, covering Official Accounts, Mini Programs, Enterprise WeChat, and WeChat Pay (V2 and V3). It provides a unified API layer for handling messaging, OAuth, media management, and payment flows, while also offering modern infrastructure features like WebSocket support, distributed caching strategies, and AI integration via the Model Context Protocol. The repository primarily serves as a demonstration suite, containing numerous sample applications across various .NET versions to illustrate these integration patterns.
How it got here
2013–2016 — SDK modernization and API expansion
96 changes.
The project underwent a significant architectural overhaul to support modern .NET environments, introducing Native AOT compatibility, dependency injection, and a unified NeuChar cross-platform abstraction. This period saw the removal of legacy XML-based message handling in favor of robust, strongly-typed entity models and the addition of extensive unit test coverage. Concurrently, the SDK expanded its feature set by implementing comprehensive wrappers for new WeChat Official Account APIs, including Card, Store, and Semantic services.
2017–2021 — Multi-platform expansion and async modernization
56 changes.
This period focused on expanding the SDK's support for .NET Core and .NET 8, introducing new WebSocket and middleware components for real-time communication and streamlined request handling. Significant architectural improvements included refactoring configuration models, enhancing cache strategies with asynchronous operations, and integrating AI agent capabilities via MCP. The work also involved adding comprehensive support for new WeChat features such as subscription messages, electronic invoices, and store mini-programs.
2022–2024 — SDK modernization and sample expansion
55 changes.
The project focused on modernizing the SDK and samples by upgrading to .NET 8 and introducing unified service registration patterns. It significantly expanded standalone sample projects for WeChat Official Accounts, Mini Programs, Work, and Pay V2/V3, while adding new APIs for drafts, free publishing, and AI integration.
2025–2026 — AI integration and .NET 10 modernization
12 changes.
This period focused on integrating AI capabilities into the SDK through a new Model Context Protocol (MCP) toolkit and Chrome extension, enabling programmatic API discovery and documentation. Concurrently, the project modernized its infrastructure by adding full support for .NET 10, Native AOT compatibility, and robust build gates for API stability and performance benchmarking.
Features
Add CsRedis-based container cache strategies
The Senparc.Weixin.Cache.CsRedis package is introduced, providing two new container cache strategies: RedisContainerCacheStrategy (using standard Redis string storage) and RedisHashSetContainerCacheStrategy (using Redis Hash structures). These strategies allow applications to store and retrieve Weixin container data (such as access tokens and menu configurations) in Redis, with support for both synchronous and asynchronous retrieval of all cached bags. A registration extension method, UseSenparcWeixinCacheCsRedis, is provided to activate these domain cache strategies within the application's dependency injection or registration service.
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis · high confidence
Add MpApiEnlightener for WeChat Official Account API abstraction
A new MpApiEnlightener class has been added to the AdvancedAPIs namespace to provide a unified interface for sending customer service messages (text, image, and news) on the WeChat Official Account platform. This implementation delegates to existing CustomApi and MediaApi methods, handling the necessary conversions and error wrapping for the NeuChar abstraction layer.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs · high confidence
Add TenPayV2 sample models and OAuth filter
The TenPayV2 sample project now includes a CustomOAuthAttribute filter for handling OAuth verification and a ProductModel class providing a static list of fake products for demonstration purposes. Additionally, view data models for the home page have been added to support the sample's UI structure.
Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Filters, Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Models · high confidence
Add TenPayV2 sample project for WeChat Pay V2
A new standalone sample project (Senparc.Weixin.Sample.TenPayV2) has been added to demonstrate the main features of WeChat Pay V2. This includes a Visual Studio solution file, ASP.NET Core MVC view imports and start configurations, and a README explaining how to open the solution and configure NuGet or source references for debugging.
Samples/TenPayV2 · high confidence
Add TenPayV3 sample application scaffolding
The TenPayV3 sample project now includes the foundational structure required to run and demonstrate WeChat Pay API V3 integration. This update adds the ASP.NET Core project configuration files (launch settings, publish profiles), Razor view imports and start files, and essential sample components such as an OAuth authentication filter, a product data model, view models for the home page, and utility helpers for generating QR codes and text images.
(repo-wide) · high confidence
Add WeChat SDK interactive notebook sample
A new interactive sample has been added to the Samples/All/notebook directory, providing a Polyglot Notebook (sample.ipynb) that demonstrates how to register and configure the Senparc WeChat SDK (including MP and WxOpen) using .NET Interactive. The sample includes a configuration file (senparc.json) with placeholders for credentials and Redis cache settings, along with a README explaining the setup steps for Visual Studio Code and the Polyglot Notebooks extension.
Samples/All/notebook · high confidence
Add WeixinResult and FixWeixinBugWeixinResult with .NET Framework 4.6.2 support
Added two new MVC result classes, WeixinResult and FixWeixinBugWeixinResult, to handle WeChat message responses. These classes support both ASP.NET MVC (via System.Web.Mvc) and ASP.NET Core (via Microsoft.AspNetCore.Mvc), with specific logic for .NET Framework 4.6.2 and later. The FixWeixinBugWeixinResult specifically addresses a WeChat iOS bug by replacing \\r\\n with \\n in text responses. Both classes ensure proper XML content type setting and response output for both frameworks.
src/Senparc.Weixin.AspNet/Results · high confidence
Add WxOpen message handler middleware
Introduces a new \WxOpenMessageHandlerMiddleware\ component for WeChat Mini Programs, enabling developers to register a message-handling pipeline via the \UseMessageHandlerForWxOpen\ extension method. This middleware handles signature verification and request parsing, allowing message processing to be configured directly in the application startup without requiring dedicated controllers.
src/Senparc.Weixin.WxOpen.Middleware · high confidence
Add WxOpen sample application views
The WxOpen sample application now includes its Razor view files, providing a user interface for the WeChat Mini Program SDK. This adds the main documentation page (Home/Index.cshtml) which guides users through installation and configuration, along with the shared layout (\_Layout.cshtml) and view imports (\_ViewImports.cshtml, \_ViewStart.cshtml) required to render the sample.
Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/Views · high confidence
Add WxOpen sample application with message handling middleware
A new standalone sample project for WeChat Mini Programs (WxOpen) has been added, demonstrating how to integrate the Senparc.Weixin SDK into an ASP.NET Core application. The sample includes configuration files for WeChat credentials and demonstrates the use of the MessageHandler middleware to receive messages directly without requiring a dedicated Controller, including an example of setting text response length limits.
Samples/WxOpen/Senparc.Weixin.Sample.WxOpen · high confidence
Add sample project static assets and UI styling
The shared sample project now includes its own set of static web assets, providing the visual foundation for the WeChat API chat interface and the general sample site layout. This adds a dedicated chat interface stylesheet (chat-interface.css) that styles the conversation UI, including a hero section, input area, and watermark, alongside a standard site stylesheet (Site.css) and a CSS reset. Additionally, jQuery UI v1.8.20 theme files and the darkTooltip plugin (CSS and JS) are added to support interactive UI components within the sample.
Samples/All/Senparc.Weixin.Sample.Shared/wwwroot · high confidence
Add shared sample view templates
The shared sample project now includes a set of Razor view templates (Error, About, Advanced, Carousel, Footer, Icons, Side notes, Source code, and Validation scripts) under Views/Shared. These provide a consistent UI for the sample application, including an error page with request ID display, informational sections about the SDK and team, a feature carousel, build/NuGet badges, source code links, and standard validation script references.
Samples/Shared/Senparc.Weixin.Sample.Shared/Views · high confidence
Add simplified WeChat Official Account sample project
A new minimal sample project (Senparc.Weixin.Sample.MP.Simple) is introduced to demonstrate the quickest way to integrate the Senparc.Weixin SDK for WeChat Official Accounts. It provides a ready-to-run ASP.NET Core application that configures the SDK via \AddSenparcWeixin\ and \UseSenparcWeixin\, implements message handling using the \MessageHandler\ middleware (eliminating the need for a dedicated Controller), and includes a sample API endpoint to retrieve user OpenIds. The project includes global usings, configuration via \appsettings.json\, and a README explaining the setup.
Samples/MP/Senparc.Weixin.Sample.MP.Simple · high confidence
Add standalone TenPayV2 sample project
A new standalone sample project for WeChat Pay V2 (TenPayV2) has been added to the Samples directory. This ASP.NET Core application demonstrates how to configure and register WeChat Official Account and WeChat Pay V2 services using the Senparc.Weixin SDK, including setup for global using statements, dependency injection, and configuration via appsettings.json.
Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2 · high confidence
Added .NET 10 and .NET 8 console sample solutions
New solution files have been added for the console samples, specifically targeting .NET 10 and .NET 8. These files define the project structure and configurations for the \Senparc.Weixin.MP.Sample.Consoles\ and \Senparc.Weixin.Net8SampleForConsole.CommonService\ projects, enabling users to build and run the console samples on these specific .NET versions.
Samples/All/console · high confidence
Added .NET Framework 4.6.2 WebSocket routing components
Introduced new WebSocketRoute and WebSocketRouteHandler classes specifically for the .NET Framework 4.6.2 target. These components implement custom routing logic to handle WebSocket requests, ensuring that URL generation does not interfere with normal operation by returning null for virtual paths.
src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes · high confidence
Added AutoReply API for retrieving WeChat Official Account auto-reply rules
The AutoReplyApi class has been introduced in the AdvancedAPIs namespace to provide access to the WeChat Official Account 'get current auto-reply info' endpoint. This new capability includes both synchronous and asynchronous methods (GetCurrentAutoreplyInfo and GetCurrentAutoreplyInfoAsync), allowing developers to programmatically retrieve the current auto-reply configuration status for a specific access token or app ID.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/AutoReply · high confidence
Added ChatLogJson result models for custom service message logs
Added the GetMsgListResultJson and GetMsgList classes to the Senparc.Weixin.MP AdvancedAPIs.CustomService.ChatLogJson namespace. These models define the structure for retrieving customer service chat logs, specifically ensuring that the message timestamp is represented as DateTimeOffset for improved timezone handling.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/ChatLogJson · high confidence
Added JSON model classes for WeChat MP Template Message API
This change introduces a new set of C\# classes in the TemplateMessageJson folder to represent the JSON responses and data structures for the WeChat Official Account Template Message API. Specifically, it adds AddtemplateJsonResult for template creation responses, GetIndustryJsonResult and GetPrivateTemplateJsonResult for retrieving industry settings and private templates (including helper methods to convert industry codes), SendTemplateMessageResult for send operation outcomes, and TemplateDataItem for defining message content data items. These models enable the SDK to properly serialize and deserialize template message interactions.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/TemplateMessage/TemplateMessageJson · high confidence
Added JSON model for retrieving WeChat MP auto-reply rules
Introduced the AutoReplyResultJson.cs file containing data models for the WeChat Official Platform's auto-reply API. This includes the GetCurrentAutoreplyInfoResult class and supporting types (AddFriendAutoReplyInfo, MessageDefaultAutoReplyInfo, KeywordAutoReplyInfo) to deserialize the response when fetching current auto-reply configurations. Notably, the KeywordAutoReplyInfo\_Item class now exposes a reply\_list\_info property, allowing access to the specific list of replies associated with a keyword rule.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/AutoReply/AutoReplyJson · high confidence
Added JSON models for WeChat Store Mini Program merchant APIs
Introduced a new set of data classes in the MerchantJson namespace to support the WeChat Store Mini Program API. These models cover merchant application data (ApplyMerchantData), store creation and updates (AddStoreJsonData, UpdateStoreData), Tencent Map POI integration (CreateMapPoiData, DistrictResultJson, PoiInMap), merchant category retrieval (MerchatResultJson), and audit status tracking (MerchantAuditInfo). This enables developers to serialize and deserialize requests and responses for managing store mini programs, including creating map points, fetching district information, and handling merchant audits.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Wxa/MerchantJson · high confidence
Added JSON result models for WeChat MP custom service sessions and user groups
This change introduces new C\# classes that define the JSON response structures for the WeChat MP Advanced APIs. In the Custom Service area, it adds models for retrieving session lists, session states, and waiting cases, enabling developers to parse customer service session data. In the Groups area, it adds models for creating groups, retrieving user group IDs, and listing user groups, allowing for proper handling of fan group management responses.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/SessionControlJson, src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Groups/GroupsJson · high confidence
Added JSON result models for WeChat subscription message template APIs
New data classes have been added to the NewTmpl namespace to support WeChat subscription message template operations. These include models for adding templates to a private library (AddTemplateJsonResult), retrieving account categories (GetCategoryJsonResult), fetching public template keywords (GetPubTemplateKeyWordsByIdJsonResult), listing public template titles by category (GetPubTemplateTitlesJsonResult), and retrieving the list of private templates (GetTemplateListJsonResult).
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NewTmpl/NewTmplJson · high confidence
Added Native AOT-compatible JSON serialization helpers
Introduced a new \WeixinJsonSerializer\ class and its associated \WeixinJsonSerializerContext\ to provide System.Text.Json source-generation capabilities. This addition enables safer, trimmer-friendly serialization for WeChat API requests and error responses, specifically improving compatibility with Native AOT environments.
src/Senparc.Weixin/Senparc.Weixin/Helpers/Serializers · high confidence
Added OAuth2.0 authorization test views for WeChat Work
The sample application now includes a new OAuth2.0 testing interface under the Work sample. Users can access the test page via the new Index view, which provides links to initiate snsapi\_base authorization and displays the current return URL configuration. Upon successful authentication, the BaseCallback view renders the user's detailed profile information (such as name, department, and avatar) retrieved from the WeChat Work API, allowing developers to verify the authorization flow and data retrieval.
Samples/Work/Senparc.Weixin.Sample.Work/Views/OAuth2 · high confidence
Added Razor view configuration for the Work sample
The Work sample application now includes standard ASP.NET Core Razor view setup files. \_ViewImports.cshtml adds necessary namespace imports (Senparc.Weixin.Sample.Work and Senparc.Weixin.Sample.Models) and registers the default MVC tag helpers, while \_ViewStart.cshtml sets the default layout to \_Layout, ensuring consistent rendering for all views in this sample.
Samples/Work/Senparc.Weixin.Sample.Work/Views · high confidence
Added SignalR WebSocket hub base class and exception handling
The library now includes a new base class, SenparcWebSocketHubBase, for .NET Core SignalR integration, which initializes a WebSocketMessageHandler and provides standard methods for receiving (ReceiveMessage) and sending messages. Additionally, a new WebSocketExceptionBase class has been added to handle WebSocket-specific errors, ensuring consistent exception management within the SignalR module.
src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/SignalR · high confidence
Added TenPay V2 sample documentation page
The sample application now includes a dedicated documentation view for the Senparc.Weixin.TenPay (WeChat Pay V2) module. This page provides users with installation instructions for the NuGet package via Visual Studio, VS Code, and the .NET CLI, along with configuration guides for JSAPI, Native, and refund payment flows.
Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Views/Home · high confidence
Added TenPayHelper utility for parsing certificate files
A new TenPayHelper class has been introduced to assist with WeChat Pay V3 certificate management. It provides methods to retrieve registration keys for merchant IDs and, crucially, utilities to parse private and public key files from virtual paths (e.g., \~/apiclient\_key.pem). These methods handle file existence checks and strip header/footer markers to return clean key strings, simplifying the integration of certificate-based authentication.
src/Senparc.Weixin/Senparc.Weixin/Helpers/TenPay · high confidence
Added TenPayV2 sample application controllers
The TenPayV2 sample project now includes a new set of ASP.NET Core controllers (BaseController, HomeController, and TenPayV3Controller) that demonstrate WeChat Pay V2 integration. These files provide the backend logic for the sample, including base configuration access, standard MVC routing, and specific payment flows such as OAuth2 authentication, JSAPI payment initiation, and order handling.
Samples/MP/Senparc.Weixin.Sample.MP.Simple/Views, Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Controllers · high confidence
Added TenPayV2 sample application documentation and layout
The TenPayV2 sample application now includes a dedicated shared layout (\_Layout.cshtml) and a series of documentation partial views (\_Partial\_01\_Register.cshtml through \_Partial\_05\_Refund.cshtml). These views provide users with step-by-step guides and code examples for registering the WeChat SDK, implementing JSAPI payments, handling payment callbacks, generating Native payment QR codes, and processing refunds.
Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Views/Shared · high confidence
Added TenPayV2 sample project configuration files
The TenPayV2 sample project now includes standard ASP.NET Core project configuration files. A new launchSettings.json file defines local development profiles for both the Project and IIS Express launch types, specifying application URLs (HTTPS on port 7068 and HTTP on port 5068) and setting the environment to Development. Additionally, a FolderProfile.pubxml file has been added to configure file-system publishing to the bin\\publish\\ directory.
Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Properties, Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/Properties · high confidence
Added TenPayV3 sample documentation and layout views
The sample application now includes a new shared layout (\_Layout.cshtml) and a series of documentation partial views (\_Partial\_01\_Register through \_Partial\_05\_Refund) that explain how to register the SDK, perform JSAPI and Native payments, handle payment callbacks, and process refunds using the TenPayV3 API.
Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Views/Shared · high confidence
Added TenPayV3 sample documentation page
A new home page for the TenPayV3 sample application has been added, providing users with an index for the WeChat Pay APIv3 module. The page includes installation instructions for the Senparc.Weixin.TenpayV3 NuGet package via Visual Studio, VS Code, and the dotnet CLI, as well as usage guides covering registration, JSAPI payments, payment callbacks, Native payments, and refunds.
Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Views/Home · high confidence
Added WeChat Official Account long/short URL conversion APIs
The \UrlApi\ class in the MP AdvancedAPIs now exposes methods to convert long URLs to short ones and to generate/fetch short keys for long data, aligning with WeChat's official short URL endpoints. This includes synchronous and asynchronous implementations for \ShortUrl\ (long URL to short URL), \GenerateShorten\ (long data to short key), and \FetchShorten\ (short key to long data), along with their corresponding result models (\ShortUrlResult\, \GenerateShortenJsonResult\, \FetchShortenJsonResult\).
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Url · high confidence
Added WeChat development resource documentation
A new 'WeChat Resource' folder has been added containing a README that serves as a central hub for WeChat development materials. It provides links to modular documentation for Official Accounts, Mini Programs, Enterprise WeChat, and WeChat Pay (V3 and V2), along with resources for AI integration, official books, video courses, and a sample message handler project.
微信资源 · high confidence
Added code result and menu button entity models
Added new entity classes to support WeChat MP API interactions: \GetDepositCountResultJson\ and \CheckCodeResultJson\ in the Card Code API for handling code import and verification responses, and \ButtonGroupBase\, \ButtonGroup\, and \IButtonGroupBase\ in the Menu entities to define custom menu button structures.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/Code, src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Menu, src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Menu/Custom · high confidence
Added data models for WeChat Card Shelf and Gift Card APIs
New C\# classes have been introduced in the Card/Shelf namespace to support WeChat's card shelf and gift card features. This includes \ShelfCreateData\ for configuring shelf pages (banner, title, scene, and card lists), \GiftCardPageData\ for defining gift card shelf properties (themes, categories, merchant info, and receipt options), and corresponding result JSON models (\ShelfCreateResultJson\, \GetGiftCardPageInfoResultJson\, etc.) for handling API responses such as shelf creation, gift card page queries, and order details.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/Shelf · high confidence
Added data models for WeChat Card Sub-merchant APIs
Introduced a new set of C\# classes in the \Senparc.Weixin.MP.AdvancedAPIs.Card.Submerchat\ namespace to support sub-merchant management for WeChat Card APIs. These models define the request and response structures for operations such as creating sub-merchants, batch retrieving merchant information, checking qualification status, and querying card category protocols, enabling developers to integrate these specific merchant management features.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/Submerchat · high confidence
Added data models for WeChat Gift Card and Social Discount activities
New C\# classes have been introduced in the \Senparc.Weixin.MP.AdvancedAPIs.Card\ namespace to support WeChat's gift card and social discount features. \GiftCardData.cs\ and \GiftCardResultJson.cs\ define the request and response structures for post-payment card distribution and pay-as-you-member rules, while \MktActivityData.cs\ and \MktActivityResultJson.cs\ provide the models for creating and managing social discount activities and their associated authorization information.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/Giftcard · high confidence
Added data models for WeChat MP customer service management
Introduced new JSON entity classes in the CustomerServiceManageJson namespace to support WeChat Official Account customer service APIs. This includes CustomInfoJson and CustomOnlineJson for retrieving customer service agent lists and their online status, GetRecordResult and RecordJson for accessing chat history records, and the Opercode enum defining session state codes. These models enable developers to interact with the updated customer service interface, including fields for WeChat ID bindings and invitation statuses.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService/CustomerServiceManageJson · high confidence
Added default publish and launch settings for the Work sample
The Work sample project now includes default configuration files for local development and publishing. A new launchSettings.json file defines the application's startup profiles, including HTTPS/HTTP URLs (localhost:7066/5066) and IIS Express settings, allowing users to run the sample immediately. Additionally, a FolderProfile.pubxml file has been added to configure file-system publishing to the bin\\publish\\ directory, streamlining the deployment process for this sample.
Samples/Work/Senparc.Weixin.Sample.Work/Properties · high confidence
Added extension method to convert event messages to text messages
A new extension method, ConvertToRequestMessageText, has been added to the Senparc.Weixin.MP.Entities namespace. This utility allows developers to easily convert IRequestMessageEventBase objects into RequestMessageText objects, automatically mapping the EventKey property to the Content field when available, simplifying event handling logic.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities · high confidence
Added performance benchmarking and gate for redaction and registration
A new benchmark entry point has been added to the Senparc.Weixin.Benchmarks project to measure the performance of sensitive data redaction and concurrent container registration. The tool runs stress tests to evaluate nanoseconds and bytes per operation, and supports a --gate mode that enforces strict performance thresholds (e.g., max 1ms per redaction, max 5ms per registration) to ensure system efficiency.
benchmarks · high confidence
Added request entity classes for card and multi-customer service events
New request message entity classes have been added to handle specific WeChat MP events. In the Card event namespace, support is added for card pass check (RequestMessageEvent\_Card\_Pass\_Check), card not pass check (RequestMessageEvent\_Card\_Not\_Pass\_Check), card pay order (RequestMessageEvent\_Card\_Pay\_Order), and card SKU stock reminder (RequestMessageEvent\_Card\_Sku\_Remind). In the Kf (multi-customer service) event namespace, support is added for session creation (RequestMessageEvent\_Kf\_Create\_Session), session closure (RequestMessageEvent\_Kf\_Close\_Session), and session switching (RequestMessageEvent\_Kf\_Switch\_Session). These classes allow the SDK to parse incoming webhook payloads for these specific event types.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/Card, src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/Kf · high confidence
Added request entity models for WeChat MP verification events
New request message entity classes have been added to handle WeChat Official Account verification event notifications, including annual renewal, qualification verification success/failure, naming verification success/failure, and verification expiration. These entities now use DateTimeOffset for timestamp properties to improve time-zone safety.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/Verify · high confidence
Added result models for card user info and activation data retrieval
Introduced the UserinfoGetResult class and related nested types (UserinfoGetResult\_UserInfo, UserinfoGetResult\_UserInfo\_Item) to represent the response structure for retrieving a user's card membership details, including fields such as openid, nickname, membership number, bonus, and user card status. Additionally, added the GetActivateTempInfoResultJson class to model the data returned when fetching information submitted by a user during the card activation process (specifically for jump-type activation components).
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/UserInfo · high confidence
Added sample MP controller structure
The sample application now includes a BaseController that exposes the WeChat AppId and MP-specific configuration settings, along with a HomeController that provides standard Index and Error views using ASP.NET Core MVC patterns.
Samples/MP/Senparc.Weixin.Sample.MP.Simple/Controllers · high confidence
Added semantic understanding API support for WeChat Official Accounts
The Semantic API area now includes the SemanticAgreement data models and the SemanticApi client. Users can send semantic understanding requests to WeChat via the new SemanticSend and SemanticSendAsync methods, providing input text, category, location, and user context to retrieve structured intent results.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Semantic · high confidence
Added semantic understanding result models for WeChat MP API
Added a comprehensive set of C\# model classes in the SemanticResult namespace to support deserialization of WeChat's semantic understanding API responses. These models cover various service intents including app, encyclopedia (baike), car instructions, cookbook, coupons, flights, hotels, general instructions, maps, movies, music, nearby services, news, novels, reminders, restaurants, web search, stocks, TV schedules, TV instructions, and telephone services, enabling developers to parse structured semantic query results.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Semantic/SemanticResult · high confidence
Added shared layout view and styles for the Work sample application
The Work sample application now includes a shared layout template (\_Layout.cshtml) and its associated CSS file (\_Layout.cshtml.css). This provides a consistent navigation structure, including a header with the Senparc logo, links to the source code and documentation, and a footer, ensuring the sample UI matches the standard ASP.NET Core project template styling.
Samples/Work/Senparc.Weixin.Sample.Work/Views/Shared · high confidence
Added simplified WeChat MP message handler sample
The simplified WeChat Mini Program sample now includes a CustomMessageHandler that demonstrates how to process text and event requests using the Senparc.NeuChar middleware. This handler overrides OnTextOrEventRequestAsync to echo text messages and provides a default response for other message types, illustrating the integration of the MessageHandler with the service provider.
Samples/MP/Senparc.Weixin.Sample.MP.Simple/MessageHandlers · high confidence
Added standalone TenPayV2 sample views for H5 and JSAPI payments
The sample application now includes a dedicated set of Razor views under the TenPayV3 folder to demonstrate TenPayV2 integration. These views provide a complete user flow for testing WeChat payments, including a product list, product details, H5 payment initiation, JSAPI (in-WeChat) payment initiation, payment success confirmation, and refund result pages.
Samples/TenPayV2/Senparc.Weixin.Sample.TenPayV2/Views/TenPayV3 · high confidence
Added support for WeChat Official Account subscription message events
The library now includes entity classes to handle three specific subscription message events from WeChat Official Accounts: message changes (\subscribe\_msg\_change\_event\), popup events (\subscribe\_msg\_popup\_event\), and sent events (\subscribe\_msg\_sent\_event\). These new request message types allow applications to correctly parse and process user interactions related to subscription message notifications.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/SubscribeMsg · high confidence
Additive quality, API compatibility, and test execution gates
The build system now includes new MSBuild projects in the \eng\ directory that provide opt-in quality and regression checks without altering the default SDK build behavior. \eng/Quality/QualityGate.proj\ introduces a \Validate\ target that builds the SDK for .NET 10 with a specific analyzer profile (\quality.globalconfig\), runs offline contract and safety tests, and executes performance benchmarks; a \ValidateFull\ target additionally runs the new \eng/ApiCompat/ApiCompat.proj\ gate. This API compatibility gate compares current \netstandard2.1\ assemblies against published NuGet baselines (e.g., Senparc.Weixin 6.24.0, Senparc.Weixin.MP 16.25.0) to ensure public API stability before publishing. \eng/Tests/OfflineTests.proj\ provides a centralized entry point to run deterministic, credential-free tests (such as contract and JSON serializer tests) across multiple modules, excluding integration or live network tests.
eng · high confidence
Advanced mass messaging API implementation for WeChat Official Accounts
The GroupMessageApi class provides a comprehensive set of synchronous and asynchronous methods for sending mass messages to WeChat users. It supports targeting audiences by user group (groupId) or tag (tagId), and handles various message types including text, images, voice, video, MP news, and WeChat cards. The implementation includes support for advanced features such as ignoring reprint restrictions, custom client message IDs for tracking, and configurable request timeouts, aligning with the WeChat Official Account platform's mass messaging capabilities.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage · high confidence
Introduce Dapr-based container caching for Weixin
Added the Senparc.Weixin.Cache.Dapr package, providing a Dapr-backed implementation of the container cache strategy (DaprContainerCacheStrategy) and a registration extension (UseSenparcWeixinCacheDapr) to enable Dapr for Weixin container data. The strategy currently exposes no capabilities and throws NotImplementedException for bulk retrieval, indicating it is a new, partially implemented integration.
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr · high confidence
Introduce Senparc.Weixin.CLI AI Harness for safe, agent-driven code modifications
The \tools\ area now includes the \Senparc.Weixin.CLI\ project, a command-line harness that integrates with \Senparc.AI.AgentKernel\ to plan and apply file changes (write, replace, delete) in a workspace. The CLI enforces strict safety policies by defaulting to dry-run, requiring SHA-256 hashes for existing files, blocking path traversal and symbolic links, and protecting sensitive files (e.g., keys, secrets). It supports multiple planning backends (file-based, external process, or AgentKernel) and includes built-in verification steps (build/test) with automatic rollback on failure. Additionally, the \WeixinBrowserPlugin\ area received documentation and code enhancements for Chrome Web Store release workflows and improved URL change detection using the History API and MutationObserver to ensure the AI assistant iframe stays in sync with the current page.
tools · high confidence
Introduce WeChat MCP Server with sample tools
Added a new \Senparc.Weixin.MCP.Server\ project that configures the application as a Model Context Protocol (MCP) server. The server is bootstrapped via \Program.cs\ to use standard I/O transport and registers \RandomNumberTools\, which exposes \GetRandomNumber\ and \GetCityWeather\ capabilities to MCP clients. The project includes an \.mcp/server.json\ manifest defining the service metadata and an \InvokeWeixinApiHelper\ class that provides reflection-based invocation for static and instance methods, supporting dynamic API calls.
src/Senparc.Weixin.MCP.Server · high confidence
Introducing Senparc.Weixin.AI Chrome Extension
This change introduces the WeixinBrowserPlugin, a new Chrome extension designed for WeChat developers. The extension automatically detects WeChat official documentation pages (developers.weixin.qq.com, pay.weixin.qq.com, and developer.work.weixin.qq.com) and injects a floating 'Senparc.Weixin.AI' button. Clicking this button opens an AI assistant interface that provides intelligent API queries and code examples based on the current page's context. The plugin includes a popup for status checking, drag-and-drop functionality for the floating button, and comprehensive documentation for installation and usage.
tools/WeixinBrowserPlugin · high confidence
Introduction of Senparc.WebSocket library with .NET 4.6.2+ and .NET Core support
A new Senparc.WebSocket library has been added, providing WebSocket capabilities via SignalR for .NET Core and ASP.NET Core, while maintaining support for .NET Framework 4.6.2 and above. The library introduces a \Register\ class for dependency injection registration (\AddSenparcWebSocket\<T\>\) and a \WebSocketConfig\ class to manage message handlers and route registration. This allows developers to easily integrate WebSocket functionality into their applications with a unified API across different .NET versions.
src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket · high confidence
Introduction of WebSocketMessageHandler base class
A new abstract base class, WebSocketMessageHandler, has been added to the Senparc.WebSocket library. This class provides a standardized structure for handling WebSocket connections by defining virtual lifecycle events for connecting and disconnecting, alongside an abstract method for processing incoming messages. This allows developers to extend this handler to implement custom WebSocket message processing logic within the library.
src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/MessageHandlers · high confidence
New .NET 10 MVC sample application
Added a new sample project for .NET 10 MVC, including the solution file, common CSS styles, and documentation. This sample allows users to test and debug the Senparc.Weixin SDK on the .NET 10.0 framework, supporting features like WeChat Official Accounts, WeChat Pay, Enterprise WeChat, and Mini Programs.
Samples/All/net10-mvc · high confidence
New .NET 10 MVC sample application with AI, QR code, and refund features
The sample application has been migrated to .NET 10, introducing a new \AiDocController\ that leverages the \AgentKernel\ and MCP toolset to provide AI-driven API documentation and code generation. The \QrCodeController\ now explicitly supports UTF-8 character sets for generating QR codes with non-Latin content. Additionally, the sample includes new manual refund pages and UI enhancements, alongside updated project structures and dependency configurations.
Samples/All/net10-mvc/Senparc.Weixin.Sample.Net10 · high confidence
New .NET 8 MVC sample application with AI and WeChat integration
A new sample application targeting .NET 8 has been introduced, providing a comprehensive demonstration of the Senparc.Weixin SDK. This sample includes an AI-powered documentation assistant (AiDocController) that leverages Model Context Protocol (MCP) and Semantic Kernel to help developers find and use WeChat APIs, along with dedicated tools for testing caching strategies (CacheController), generating and downloading QR codes (QrCodeController, DocumentController), and simulating WeChat message events (SimulateToolController).
Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8 · high confidence
New .NET 8 MVC sample project
A new sample project targeting .NET 8 MVC has been added, providing a comprehensive integration example for the Senparc.Weixin SDK. This sample includes a solution file referencing the .NET 8 versions of core libraries (such as Senparc.Weixin, Senparc.Weixin.MP, and Senparc.Weixin.TenPay) and is designed to help developers test and debug the SDK on the .NET 8 platform.
Samples/All/net8-mvc · high confidence
New ApiUtility class for token expiration and AppId validation
A new ApiUtility class has been added to the WeixinUtility namespace, providing static methods for WeChat API operations. It includes IsAppId to validate whether a string is an AppId (or Enterprise WeChat AppKey) by delegating to a configurable check function, and GetExpireTime/GetExpiryTimeSpan to calculate token expiration times with built-in buffer logic that subtracts time (10, 5, or 1 minute) based on the token's validity duration to ensure proactive refresh.
src/Senparc.Weixin/Senparc.Weixin/Utilities/WeixinUtility · high confidence
New CommentApi for WeChat Official Account comment management
Added the CommentApi class in the Senparc.Weixin.MP library, providing synchronous methods to interact with the WeChat Official Account comment data management API. This includes capabilities to open and close comments on published articles, list comments with pagination and filtering options, and mark specific comments as featured (selected).
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment · high confidence
New ContainerHelper utility for cache key generation
A new ContainerHelper class has been added to the Senparc.Weixin library to standardize the generation of cache keys for container bags. This utility provides static methods to construct hierarchical cache keys by combining a container namespace (e.g., 'Container:Senparc.Weixin.MP.Containers.AccessTokenBag') with specific short keys (such as an AppId), ensuring consistent key formatting across the application's caching layer.
src/Senparc.Weixin/Senparc.Weixin/Helpers/Containers · high confidence
New Free Publish API support for WeChat Official Accounts
Added the FreePublish API client to enable developers to submit, poll, delete, and retrieve published articles via the WeChat Official Account platform. This includes synchronous and asynchronous methods for submitting drafts for publication, checking publish status, removing published content, fetching published article details, and listing successfully published items, along with the corresponding JSON result models.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/FreePublish · high confidence
New InvoiceApi class for WeChat Official Account electronic invoice management
The new InvoiceApi class in the MP AdvancedAPIs namespace provides a comprehensive set of synchronous methods for managing electronic invoices on WeChat Official Accounts. This includes operations for setting and querying payment merchant associations, configuring and retrieving authorization page fields, obtaining authorization data and URLs, and handling invoice issuance, red-invoicing, and status updates. The implementation uses the NcApiBind attribute to target WeChat Official Accounts and relies on the Senparc.CO2NET and NeuChar libraries for HTTP handling and platform abstraction.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice · high confidence
New JSON result models for WeChat MP Media APIs
Added a set of new C\# classes in the MediaJson folder to model the response structures for various WeChat MP media operations. These include models for retrieving permanent media (with content-type support for non-news/video types), fetching media counts and lists (distinguishing between news and other media types), retrieving permanent news articles, updating permanent news data, and uploading both temporary and permanent media files. This expands the library's ability to handle detailed responses from the WeChat media management APIs.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaJson · high confidence
New Scan API support for merchant and product management
The Scan API now includes methods to retrieve merchant information, create and manage products (including setting review status and batch querying), configure test whitelists, and generate product QR codes. This change introduces the corresponding request and response entity classes (such as BrandInfo and MerchantInfoGetResultJson) to support these WeChat Official Account product-scan features.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Scan · high confidence
New Senparc.Weixin.All package with automatic platform registration
A new Senparc.Weixin.All package has been introduced to simplify integration by automatically referencing all Senparc.Weixin.\* sub-packages. It provides a \UseSenparcWeixin\ extension method that supports an \autoRegisterAllPlatforms\ flag; when enabled, it automatically registers WeChat Official Accounts, Mini Programs, Enterprise WeChat, and both WeChat Pay V2 and V3 based on the configuration settings, removing the need for manual per-platform registration.
src/Senparc.Weixin.All · high confidence
New ShakeAround API response models added
The ShakeAround API now includes a comprehensive set of new C\# classes in the ShakeAroundJson folder to represent API response data. These models cover device management (DeviceApplyResultJson, DeviceSearchResultJson, DeviceListResultJson), page management (AddPageResultJson, UpdatePageResultJson, SearchPagesResultJson, PageListResultJson), group management (GroupAddResultJson, GroupGetDetailResultJson, GroupGetListResultJson), lottery/lottery info (AddLotteryInfoResultJson, QueryLotteryJsonResult, SetPrizeBucketResultJson, PrizeInfoList), and general operations like registration (RegisterResultJson, RegisterData), audit status (GetAuditStatusResultJson, GetDeviceStatusResultJson), statistics (StatisticsResultJson), and image uploads (UploadImageResultJson). This allows developers to strongly type their interactions with the WeChat ShakeAround API.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround/ShakeAroundJson · high confidence
New Store API support for WeChat Mini Program merchant and location management
Added new APIs in the Store namespace to interact with WeChat's Mini Program merchant and map services. This includes methods to retrieve merchant categories, apply for and manage merchant status, query audit results, and handle store locations via Tencent Maps (searching, creating POIs, and adding/updating store details). Corresponding data models and result JSON classes have been introduced to support these operations.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/Store · high confidence
New TenPay V3 sample application with API V3 support
Added a new standalone sample application for WeChat Pay API V3, including controllers for base configuration, home navigation, and comprehensive payment flows (JSAPI, Native, etc.). The sample demonstrates the updated V3 integration, including signature verification and transaction handling, replacing or supplementing previous V2 examples.
Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Controllers · high confidence
New WeChat MCP Toolkit for AI-assisted API discovery
Senparc.Weixin.AspNet now includes a Model Context Protocol (MCP) server toolkit that allows AI agents to programmatically discover and understand WeChat APIs. The new WeChatMcpRouter exposes tools to list supported platforms (Official Accounts, Mini Programs, Open Platform, WeCom), search API catalogs within a specific platform, and retrieve detailed API method signatures and parameters. This enables developers to integrate WeChat SDK capabilities directly into AI workflows via standard MCP interfaces.
src/Senparc.Weixin.AspNet/MCP · high confidence
New WeChat Mini Program SDK demo with login, live streaming, and WebSocket features
Added a new standalone WeChat Mini Program sample application (\Senparc.Weixin.WxOpen.AppDemo\) that demonstrates core SDK capabilities. The demo includes a complete user login flow using \wx.getUserProfile\ and server-side session management, a live streaming interface via the \LivePusher\ component, and real-time communication pages supporting both raw WebSockets and SignalR hubs. It also features pages for generating custom QR codes, retrieving user phone numbers, and displaying startup logs, providing a comprehensive reference for integrating the Senparc WeChat SDK.
Samples/WxOpen/Senparc.Weixin.WxOpen.AppDemo · high confidence
New WeChat Official Account APIs for Medical Assistant, Non-Tax Payments, and One-Code Marketing
This release adds official API wrappers and strongly-typed data models for three new WeChat Official Account capabilities. The Medical Assistant module enables sending channel messages to users in a hospital appointment flow. The Non-Tax Pay module supports querying fee information, creating unified payment orders, downloading bills, handling refunds, and processing micro-payments for government non-tax collections. The OneCode module provides endpoints for applying for, downloading, and activating marketing QR codes, as well as querying their status and exchanging scan tickets for codes.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MedicalAssistant, src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NonTaxPay, src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OneCode · high confidence
New WeChat Official Account CV APIs for Image Analysis and OCR
This update adds the \Senparc.Weixin.MP.AdvancedAPIs.CV\ namespace, introducing new wrappers for WeChat's Intelligent Interface APIs. The \ImageApi\ class provides methods for AI image cropping (supporting both URL and file uploads) and QR code/barcode recognition. The \OCRApi\ class adds support for recognizing various document types, including ID cards, bank cards, driving licenses, business licenses, vehicle driving permits, license plates, and menus, as well as general text OCR. Strongly-typed result models (e.g., \IdCardJsonResult\, \AiCropJsonResult\) are included to parse the API responses.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CV · high confidence
New WeChat Official Account Draft and Product Card APIs
Developers can now manage drafts and integrate product cards in WeChat Official Account articles. This update adds the Draft API for creating, retrieving, updating, deleting, and listing drafts, as well as checking the draft box status. It also introduces the Product Card API, allowing developers to fetch the DOM structure needed to insert video account product cards into articles with various display styles.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Draft · high confidence
New WeChat Official Account MessageHandler middleware with IServiceProvider support
A new middleware component (MpMessageHandlerMiddleware) has been added to handle WeChat Official Account message routing and signature verification. This middleware now accepts an IServiceProvider in its constructor, allowing dependency injection within the message handling pipeline. It provides a dedicated extension method (UseMessageHandlerForMp) to register the handler in the ASP.NET Core request pipeline, simplifying the setup for custom message handlers without requiring additional controllers.
src/Senparc.Weixin.MP.Middleware · high confidence
New WeChat Official Account template message models and API support
Added new data models and API methods to support WeChat Official Account template messaging, including one-time subscription messages and blocked message queries. The update introduces \SubscribeMsgTemplateModel\ for one-time subscriptions, \QueryBlockTemplateMessageResult\ for querying blocked template messages, and updates \TemplateApi\ with methods like \GetSubscribeMsgUrl\ and \SendTemplateMessage\ to handle these new capabilities.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/TemplateMessage · high confidence
New WeChat Pay V3 sample UI pages
The TenPayApiV3 sample now includes a set of new Razor view templates (Index, JsApi, ProductItem, ProductList, Refund) that provide a modern, responsive interface for testing WeChat Pay V3 flows. Users can browse a product list, select items to view details, and initiate payments via H5, Native QR code, or WeChat JS-SDK, with a dedicated confirmation page and refund result view.
Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3/Views/TenPayApiV3 · high confidence
New WeChat Work sample application with JSSDK and message handling demos
A new sample project for WeChat Work (Enterprise WeChat) has been added, providing a complete ASP.NET Core application structure. It demonstrates how to configure and register WeChat Work accounts, handle incoming messages via the \MessageHandler\ middleware (including text response length limits), and integrate the WeChat JSSDK for features like custom approval workflows and message sharing.
Samples/Work/Senparc.Weixin.Sample.Work · high confidence
New WeChat Work sample controllers and message handlers
Added new sample controllers (AdvancedApi, JSSDK, OAuth2, Work) and custom message handlers to demonstrate WeChat Work integration features including API calls, JSSDK configuration, OAuth2 authentication, and message handling.
Samples/Work/Senparc.Weixin.Sample.Work/Controllers · high confidence
New WeixinRegister entry point and .NET 8+ MCP router support
The Senparc.Weixin.AspNet library now includes a new WeixinRegister.cs file that provides a unified UseSenparcWeixin extension method for initializing both CO2NET and Weixin SDKs, featuring a useSenparcWeixin parameter to control automatic registration execution. Additionally, for .NET 8 and greater, the library introduces an AddMcpRouter method that configures a Model Context Protocol (MCP) server with HTTP transport and registers WeChat-specific tools, enabling AI integration via the MCP standard.
src/Senparc.Weixin.AspNet · high confidence
New Work Sample documentation page
Added a new Home/Index.cshtml view for the Senparc.Weixin.Work sample application, providing a user-facing documentation page that explains how to install the Senparc.Weixin.Work NuGet package (via Visual Studio, VS Code, or CLI) and how to register the SDK in a .NET application.
Samples/Work/Senparc.Weixin.Sample.Work/Views/Home · high confidence
New Work WeChat MessageHandler middleware with service provider support
Adds the WorkMessageHandlerMiddleware component for the Senparc WeChat Work SDK, enabling developers to integrate WeChat Work message handling directly into the ASP.NET Core request pipeline via the new UseMessageHandlerForWork extension. The middleware now accepts an IServiceProvider in its constructor, allowing dependency injection within message handlers, and implements signature verification logic specific to the WeChat Work platform.
src/Senparc.Weixin.Work.Middleware · high confidence
New WxOpen sample application with custom message handling
The sample application now includes a dedicated WxOpen controller and custom message handler to demonstrate advanced WeChat Mini Program integration. This addition provides a concrete example of handling URL verification, processing user login via code exchange, and managing custom message routing with context tracking, serving as a reference for implementing similar asynchronous message handling in your own applications.
Samples/WxOpen/Senparc.Weixin.Sample.WxOpen/Controllers · high confidence
New base classes and interfaces for entity models
The Entities folder now includes BindableBase, a base class implementing INotifyPropertyChanged to support data binding scenarios, and several new interfaces: IAccessTokenResult for standardizing access token responses, IUserInfo and IUserSubscribe for user profile data, and a commented-out IApiData interface. These additions provide structural foundations for entity classes but do not yet change existing behavior as no concrete classes implement them in this diff.
src/Senparc.Weixin/Senparc.Weixin/Entities · high confidence
New container cache strategy infrastructure and capabilities
The Cache directory now introduces a new container cache strategy implementation. This includes a new \ContainerCacheCapabilities\ enum and extension methods that allow cache backends to declare support for enumeration and paging, providing bounded pagination for container data. A dedicated \ContainerCacheStrategyDomain\ singleton is added to define the cache domain identity, and a \ContainerCacheStrategyFactory\ is provided to retrieve the active container cache strategy instance from the underlying extension cache system.
src/Senparc.Weixin/Senparc.Weixin/Cache · high confidence
New helper classes for entity and event processing
Added EntityHelper and EventHelper classes to the MP Helpers namespace. EntityHelper provides utility methods for entity operations, including checking if a subscription request originates from a scene QR code. EventHelper facilitates the conversion of XML event fields into Event enums, simplifying event type identification in incoming messages.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers · high confidence
New helper utilities for JSON result parsing and user avatar handling
Added two new helper classes to simplify common tasks: JsonResultHelper provides extension methods to extract the 'rid' identifier from error messages in WxJsonResult and ErrorJsonResultException objects, while UserHelper offers utilities to generate square avatar URLs of specific sizes (0, 46, 64, 96, 132) from user info and to parse subscription timestamps from XML data.
src/Senparc.Weixin/Senparc.Weixin/Helpers · high confidence
New invoice data models and API response structures
Added new C\# classes in the InvoiceJson folder to support WeChat MP invoice APIs, including request models for authorization URLs, platform invoice templates, and unified invoice issuance, as well as response models for card insertion, PDF handling, and invoice information queries.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Invoice/InvoiceJson · high confidence
New sample deployment and publishing scripts for .NET 8
Added a PowerShell script (deploy-sample-net8.ps1) to facilitate deploying sample applications to remote servers via SCP, with logic to temporarily exclude configuration files like Web.Config and appsettings.json during transfer. Additionally, a batch file (sample-publish.bat) was introduced to streamline the local publishing of specific sample projects (MP, TenPayV2, TenPayV3, Work, WxOpen) targeting .NET 8, and a new README documents the structure and SDK usage for the various sample modules.
Samples · high confidence
New standalone MP sample application with modern ASP.NET Core architecture
The MP sample has been restructured into a standalone ASP.NET Core MVC application, replacing the previous legacy implementation. This new sample demonstrates modern integration patterns, including the use of the MessageHandler middleware for receiving WeChat messages (configured in Program.cs) alongside traditional Controller-based handling for OAuth2.0 and JSSDK features. It provides comprehensive examples for text, image, location, and event message processing via a custom MessageHandler, along with dedicated OAuth2.0 flows (snsapi\_base and snsapi\_userinfo) and JSSDK initialization.
Samples/MP/Senparc.Weixin.Sample.MP · high confidence
New standalone WeChat MP sample solution with simplified demo
A new standalone solution (Senparc.Weixin.Sample.MP.sln) has been added for the WeChat MP (Public Account) sample, providing a more focused way to explore the library's features. This solution includes two projects: Senparc.Weixin.Sample.MP, which demonstrates the main functionalities, and Senparc.Weixin.Sample.MP.Simple, which offers a minimalistic example. The sample is configured to use NuGet packages by default, but instructions are provided in the readme for switching to source code references for debugging purposes.
Samples/MP · high confidence
New standalone WeChat Mini Program sample project with NuGet references
A new standalone sample project for WeChat Mini Program (WxOpen) functionality has been added, including a solution file, an .editorconfig for consistent formatting, and a readme. The sample is configured to reference the Senparc.Weixin packages via NuGet by default, providing a simplified entry point for developers to understand and integrate WeChat Mini Program server-side features without needing the full monolithic sample solution.
Samples/WxOpen · high confidence
New standalone WeChat Work sample project with NuGet package references
A new standalone sample solution (Senparc.Weixin.Sample.Work) has been added to demonstrate WeChat Work (Enterprise WeChat) features. The project is configured to reference the library via NuGet packages by default, providing a simpler setup for users who want to try the functionality without managing source code links. A readme file explains how to open the solution and provides instructions for switching to source code references if debugging the library source is required.
Samples/Work · high confidence
New standalone sample for WeChat Pay API V3
A new independent sample application (Senparc.Weixin.Sample.TenPayV3) has been added to demonstrate WeChat Pay API V3 integration. This ASP.NET Core project includes the necessary configuration files (appsettings.json) for API V3 credentials (such as APIv3Key, private keys, and serial numbers) and registers the TenPayV3 service via the Senparc SDK. It also sets up Session support and standard middleware, providing a concrete reference implementation for developers integrating the new payment API version.
Samples/TenPayV3/Senparc.Weixin.Sample.TenPayV3 · high confidence
New standalone sample for WeChat Pay APIv3
A new sample project has been added to demonstrate the primary features of WeChat Pay APIv3. This includes a Visual Studio solution file that references the shared sample project and a .NET 8-specific implementation project, along with a README file explaining the sample's purpose.
Samples/TenPayV3 · high confidence
New store mini-program API endpoints for Tencent Maps integration
The WxaApi class now exposes methods to manage store mini-programs, including retrieving merchant categories, applying for merchant status, checking audit results, and modifying merchant information. It also adds integration with Tencent Maps, allowing developers to fetch district/province/city data, search for points of interest, create map POIs, and add stores directly through the SDK.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Wxa · high confidence
New strong-typed JSON result models for MP API responses
Added strongly-typed entity classes in the \Senparc.Weixin.MP.Entities.JsonResult\ namespace to represent JSON responses from WeChat Official Account APIs. This includes \AccessTokenResult\ and \JsApiTicketResult\ for credential retrieval, \GetApiDomainIpResult\ and \GetCallBackIpResult\ for fetching WeChat server IP ranges, and \CallbackCheckJsonResult\ (with associated enums and sub-models) for network connectivity checks. These models provide structured access to fields such as \access\_token\, \ticket\, \ip\_list\, and detailed DNS/Ping check results.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult · high confidence
New subscription message API for WeChat Official Accounts
Added the NewTmplApi class to support WeChat Official Account subscription notifications. This includes methods to retrieve public template titles and keywords, add templates to the private library, manage private templates (list and delete), retrieve account categories, and send subscription messages (BizSend) with support for mini-program redirects.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/NewTmpl · high confidence
New template message entity classes and base interface
Added new classes to support template message data structures: TemplateMessageData and TemplateMessageDataValue for handling key-value message content, and a new base class TemplateMessageBase with the ITemplateMessageBase interface providing common properties like TemplateId, Url, and TemplateName for all template message entities.
src/Senparc.Weixin/Senparc.Weixin/Entities/TemplateMessage · high confidence
New unified service registration and relative certificate path support
The library now provides a new \AddSenparcWeixin()\ extension method for \IServiceCollection\, which simplifies setup by automatically registering global CO2NET services and configuring WeChat settings from \appsettings.json\. This method also introduces support for relative paths for WeChat Pay V3 certificates (e.g., \\~/App\_Data/...\), resolving previous issues where certificate parameters might be null or required absolute paths, thereby improving startup performance and security configuration flexibility.
src/Senparc.Weixin.AspNet/RegisterServices · high confidence
OAuth authorization URL now supports forced popup confirmation
The \OAuthApi.GetAuthorizeUrl()\ method in the WeChat MP SDK now accepts an optional \forcePopup\ parameter. When set to true, this forces the WeChat authorization page to display a confirmation dialog to the user, overriding the default behavior where certain scenarios might trigger silent authorization. This allows developers to explicitly require user interaction during the OAuth flow.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth · high confidence
Publishes internal Senparc development standards and SDK maintenance guides
The repository now includes a dedicated 'Specification Documents' area containing the official Senparc C\# coding standards (including file header and asynchronous method marking conventions), an SDK contributor points system, and a step-by-step guide for adding new RequestMsgType entries to the Senparc.Weixin SDK. Additionally, flowcharts are provided to illustrate the WeChat AI Assistant MCP integration process and the SDK's automatic handling of long-text message responses.
规范文档 · high confidence
Support for WeChat Gift Card and Store Audit Event Pushes
The MP SDK now handles new WeChat event push types by introducing dedicated request message entities and corresponding Event enum values. This includes Gift Card events (payment completion, sending to friends, and user acceptance) and Mini Program store audit events (merchant audit info, map POI audit, and store creation/modification). Developers can now process these specific webhook payloads using the new entity classes.
src/Senparc.Weixin.MP/Senparc.Weixin.MP · high confidence
User Tag API implementation for WeChat Official Accounts
The UserTagApi class and its associated JSON result models (CreateTagResult, TagJson, UserTagJsonResult, UserTagListResult) have been added to the Senparc.Weixin.MP library. This provides developers with a unified interface to manage user tags on WeChat Official Accounts, including creating, editing, and deleting tags, as well as retrieving tag lists and managing user tag assignments (batch tagging/untagging). The implementation uses the NcApiBind attribute to support custom API domain configurations.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/UserTag · high confidence
WeChat MP Card API implementation added
The Card API module for the WeChat Official Account platform has been introduced, providing a comprehensive set of methods to manage various card types including general coupons, group-ons, gifts, cash, discounts, and member cards. This addition enables developers to create, query, and update card information, as well as handle related operations such as batch retrieval, user updates, and gift card shelf management.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card · high confidence
WeChat MP Media Management API Implementation
The MediaApi class in the Senparc.Weixin.MP library provides a comprehensive set of methods for managing WeChat Official Account media assets. This includes uploading temporary and permanent materials (images, voice, video, and news articles), downloading temporary media to streams or specific directories, and retrieving permanent media with content-type support. The implementation utilizes the NcApiBind attribute for platform-specific binding and leverages CO2NET for HTTP operations, ensuring consistent API handling across the Senparc ecosystem.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media · high confidence
WeChat MP Store Management API implementation
The PoiApi class in the Senparc.Weixin.MP library now provides synchronous methods for managing WeChat Official Account store locations (POIs). This includes uploading store images, creating new stores, querying individual store details, listing stores, and deleting stores, all interacting with the standard WeChat MP API endpoints.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Poi · high confidence
WeChat MP User Group Management API Implementation
The GroupsApi class in the Senparc.Weixin.MP library now provides a complete set of synchronous methods for managing user groups on WeChat Official Accounts. This includes creating groups, retrieving all groups, checking a user's current group, updating group names, and moving users between groups (both individually and in batches). The implementation leverages the unified CommonJsonSend.Send\<T\>() method for API requests and supports configurable request timeouts.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Groups · high confidence
WeChat Mini Program Demo updated for .NET 6 and AI agent integration
The WxOpen demo application has been migrated to target .NET 6.0, with the client-side configuration updated to point to the corresponding local development server (localhost:44382). The demo now includes a new Live Pusher page for testing real-time streaming and integrates a new AI agent skill package (senparc-login-ws) to demonstrate login authentication and WebSocket communication capabilities.
src/Senparc.Weixin.WxOpen · high confidence
WeChat Multi-Customer Service API Implementation
The CustomServiceApi class in the Senparc.Weixin.MP library now provides a comprehensive set of synchronous methods for interacting with the WeChat Official Account multi-customer service interface. This includes capabilities to retrieve user chat records (GetRecord), fetch basic and online information for customer service agents (GetCustomBasicInfo, GetCustomOnlineInfo), and manage customer service accounts by adding new agents (AddCustom). The implementation handles necessary data transformations, such as converting DateTime objects to Unix timestamps for API requests, and integrates with the Senparc.CO2NET and NeuChar frameworks for unified API binding and HTTP handling.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/CustomService · high confidence
WeChat Official Account AI Chat Demo with Long-Context Memory and Markdown Support
The sample application now includes a comprehensive AI chat demo for WeChat Official Accounts, featuring a new \ChatStore\ for per-user, isolated conversation history and a \CustomMessageHandler\_AI\ that integrates with \Microsoft.Extensions.AI\ and \AgentKernel\. Users can engage in long-context conversations (enabled via the 'lc' command) where the AI automatically summarizes and stores memory after a set number of turns to maintain context. The demo also supports multimodal interactions (text and image generation via the 'img' command), Markdown-formatted output (toggleable with 'dm'), and state management for pausing ('p') or exiting ('e') chats.
Samples/All/Senparc.Weixin.Sample.CommonService · high confidence
WeChat Official Account Analysis API implementation added
The AnalysisApi class in the Senparc.Weixin.MP library now provides a comprehensive set of synchronous methods for retrieving WeChat Official Account analytics data. This includes endpoints for article summaries and totals, user reading statistics (daily and hourly), and user sharing data, allowing developers to programmatically access detailed content and audience performance metrics.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Analysis, src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/User · high confidence
Removals
Removal of EntityHelper XML serialization and deserialization logic
The EntityHelper class, which previously handled the conversion of WeChat message entities to and from XML (including specific handling for message types, dates, and field ordering), has been removed from the codebase. This eliminates the legacy reflection-based XML mapping logic used for populating request entities and generating response payloads.
Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers · high confidence
Removal of legacy CheckSignature and RequestMessageFactory classes
The legacy CheckSignature utility class and the RequestMessageFactory class have been removed from the Senparc.Weixin.MP library. This eliminates the older, static methods for verifying WeChat signature tokens and parsing basic request message entities, indicating a shift toward newer, more robust APIs for signature validation and message handling.
Senparc.Weixin.MP/Senparc.Weixin.MP · high confidence
Removal of solution and IDE configuration files
The Senparc.Weixin.MP.sln solution file and the associated .DotSettings.user IDE configuration file have been removed from the repository. This change eliminates the local development environment metadata and solution structure for this specific project directory.
Senparc.Weixin.MP · high confidence
Security
WeixinTrace now redacts sensitive data and truncates log bodies
The WeixinTrace logging component now automatically masks sensitive information (such as access tokens, app secrets, and personal identifiers) in API request/response logs and limits the length of logged message bodies to prevent excessive log volume. This change ensures that sensitive credentials are not exposed in plain text within trace files and helps manage log storage size by truncating long payloads.
src/Senparc.Weixin/Senparc.Weixin/Trace · high confidence
Behavioural changes
2 commits (0 fixes) modifying Senparc.Weixin.MP/Senparc.Weixin.MP/bin
A change to existing behaviour in Senparc.Weixin.MP/Senparc.Weixin.MP/bin — 2 commits, 2 files.
Senparc.Weixin.MP/Senparc.Weixin.MP/bin · medium confidence · unverified
Add static analysis annotations and update assembly metadata
The library now includes the \Annotations.cs\ file, which adds ReSharper-style attributes (such as \CanBeNull\, \NotNull\, and \NotifyPropertyChangedInvocator\) to improve static code analysis and IDE IntelliSense for developers using the SDK. Additionally, the \AssemblyInfo.cs\ file has been updated to set the assembly version to 6.6.101.\* and the copyright year to 2018.
src/Senparc.Weixin/Senparc.Weixin/Properties · high confidence
Analysis API result models reorganized and expanded with new fields
The analysis API response models have been reorganized into a dedicated \AnalysisResultJson\ folder and expanded to support newer WeChat Official Account API capabilities. The \ArticleTotalItem\ model now includes a \user\_source\ property to identify the user's entry channel (e.g., session, friends, Moments), and the \UserSummaryItem\ model also exposes \user\_source\ for user acquisition tracking. Additionally, a new \PublishedArticleAnalysisItemJson\ file introduces models for the newer published content statistics API, including detailed read, share, and business summary data (such as \read\_finish\_rate\ and \zaikan\_user\), while base result classes (\BaseAnalysisResult\, \BaseAnalysisObject\) have been refactored to provide a cleaner inheritance structure for these typed responses.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Analysis/AnalysisResultJson · high confidence
Asynchronous Message Handler implementation for WeChat MP
The MessageHandler in the Senparc.Weixin.MP library now fully supports asynchronous processing for incoming WeChat requests. This change introduces async variants for all message and event handling methods (such as OnEventRequestAsync, OnTextRequestAsync, and OnNeuCharRequestAsync) and updates the core BuildResponseMessageAsync flow to utilize these methods. This allows applications to handle high-concurrency message traffic more efficiently without blocking threads, while maintaining compatibility with existing synchronous override patterns through a default method adapter.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers/Async · high confidence
Browser detection methods now support ASP.NET Core
The BrowserUtility class has been updated to support both ASP.NET Framework and ASP.NET Core environments. The SideInWeixinBrowser and SideInWeixinMiniProgram extension methods now accept HttpContextBase in .NET Framework 4.6.2+ and HttpContext in .NET Core, allowing applications to correctly detect WeChat browser and mini-program contexts regardless of the underlying web framework.
src/Senparc.Weixin.AspNet/Utilities/BrowserUtility · high confidence
Card base info model updates and new files
The Card\_BaseInfoBase model now includes the sub\_merchant\_info property for sub-merchant identification, changes the get\_limit property type from int to long to support larger limits, and adds custom\_app\_brand\_user\_name and custom\_app\_brand\_pass properties to support jumping to mini-programs from the card entry. Additionally, new model files have been introduced: Card\_BaseInfo\_DateInfo for defining card validity periods, Card\_BaseInfo\_Sku for managing card inventory quantities, and Card\_BaseInfo\_member\_card\_SwipeCard to support WeChat Pay swipe-card functionality for member cards.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/Common · high confidence
Card creation API data models reorganized and expanded
The card creation data structures have been reorganized into a new \CardCreate\ sub-namespace, introducing dedicated classes for various card types (such as \Card\_GeneralCouponData\, \Card\_MemberCardData\, and \Card\_CashData\) and a unified \CardCreateInfo\_Card\ hierarchy. This change adds support for new WeChat API features, including custom cells for member cards, sub-merchant information for group-buying cards, and specific activation parameters for member cards, while also updating copyright years to 2026.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardCreate · medium confidence
Console sample updated to .NET 8 with modern initialization patterns
The Weixin MP console sample has been upgraded to .NET 8, replacing the legacy entry point with top-level statements and adopting the standard Microsoft.Extensions.Hosting configuration builder. This change simplifies the setup process by using \AddSenparcWeixinServices\ and \UseSenparcWeixin\ for dependency injection and configuration, while the accompanying \appsettings.json\ provides a comprehensive template for WeChat, Mini Program, and WeChat Pay credentials.
Samples/All/console/Senparc.Weixin.MP.Sample.Consoles · high confidence
Container cache strategy now supports asynchronous operations and capability detection
The container cache strategy has been refactored to include full asynchronous support for retrieving and updating container bags, with all async methods using ConfigureAwait(false) to prevent potential deadlocks. The new BaseContainerCacheStrategy implementation exposes a Capabilities property that indicates support for enumeration, asynchronous enumeration, and paging, allowing consumers to detect available features. The interface and base class now provide both synchronous and asynchronous versions of GetAll, GetContainerBag, and UpdateContainerBag, ensuring consistent behavior across different caching backends while maintaining automatic CacheTime updates on bag modifications.
src/Senparc.Weixin/Senparc.Weixin/Cache/ContainerCacheStrategy · high confidence
Container registration and caching mechanisms enhanced with concurrency, capacity, and credential support
The Weixin container system now supports hot-swappable cache strategies, ensuring that changes to the underlying cache implementation take effect without requiring an application restart. To prevent resource exhaustion in distributed environments, registration callbacks are now managed with strict concurrency controls and configurable capacity limits (defaulting to 10,000). Additionally, a new external credential provider interface allows applications to integrate with secure secret management systems like Key Vault, while message context safety options enforce maximum record counts to prevent unbounded memory growth.
src/Senparc.Weixin/Senparc.Weixin/Containers · high confidence
Deprecation of gender and location fields in conditional menu matching rules
The \MenuMatchRule\ entity for personalized menus has been updated to align with WeChat's API changes: the \sex\, \country\, \province\, and \city\ properties are now marked as obsolete because the platform no longer returns user gender and region information. Users relying on these fields for conditional menu targeting should switch to supported criteria such as \tag\_id\, \group\_id\, \client\_platform\_type\, or \language\.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Menu/Conditional · high confidence
Enhanced JSON API request handling with Native AOT support and detailed error hints
The CommonAPIs module has been updated to improve reliability and compatibility for modern .NET environments. The CommonJsonSend class now supports Native AOT by utilizing JsonTypeInfo for serialization and includes a dedicated HttpClient instance that disables cookies to prevent interference. Error reporting has been enhanced: POST request failures now extract and display detailed 'Hints' from the WeChat API response in exception messages, and the library has removed unnecessary UTF-8 buffering for JSON requests to optimize performance. Additionally, a new CommonDI class provides a centralized service provider for dependency injection, ensuring consistent service resolution across the API layer.
src/Senparc.Weixin/Senparc.Weixin/CommonAPIs · high confidence
Enhanced comment list response structure for WeChat MP articles
The return data model for the 'View specified article's comment data' API (CommentApi.List) has been expanded to include detailed comment reply information. The new ListResultJson structure now exposes a 'reply' object within each comment entry, containing the author's reply content and the timestamp of that reply, allowing users to retrieve both original comments and their associated replies in a single API call.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Comment/CommentJson · high confidence
Expanded WeChat Menu Entity Models with Mini Program and Article Support
The SDK introduces new and updated entity classes in the menu result namespace to support richer WeChat menu structures. New files \CreateMenuConditionalResult.cs\ and \GetMenuResult.cs\ provide models for conditional menu creation and standard menu retrieval, including support for conditional menu lists. The \GetMenuResultFull.cs\ file is significantly expanded with \MenuFull\_ButtonGroup\, \SelfMenuFull\_ButtonGroup\, and \SelfMenuConfigResult\ classes, which now include properties for Mini Program integration (\appid\, \pagepath\) and article-based menu items (\article\_id\, \article\_view\_limited\), aligning with recent WeChat API updates for custom menus.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/JsonResult/Menu · high confidence
Expanded data models for WeChat Card and Coupon management
The CardManage API now supports more granular configuration and retrieval of WeChat card types. New data models allow developers to define specific activation form fields (required and optional) for member cards, including custom rich-text inputs. The update also introduces detailed result structures for various card types (general, group-buying, gift, cash, discount, member, scenic, movie, boarding pass, lucky money, and meeting tickets) and provides comprehensive update data structures for modifying card details, such as member card bonus/balance rules, auto-activation settings, and custom fields.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Card/CardManage · high confidence
Fixes race conditions and potential deadlocks in WeChat MP container registration
The AccessToken, JsApiTicket, OAuthAccessToken, and WxCardApiTicket containers in the Senparc.Weixin.MP library have been updated to resolve synchronization issues during registration. The synchronous Register methods now safely invoke their asynchronous counterparts using ConfigureAwait(false) to prevent thread deadlocks, and the implementation ensures that registration is fully completed before the method returns to avoid race conditions where a token might be requested before it is available. Additionally, distributed locks are now used to re-read the token or ticket status inside the critical section, ensuring that expired or missing credentials are correctly refreshed even in high-concurrency or distributed cache scenarios.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers · high confidence
Group message API models updated with clientmsgid, comment controls, and analytics fields
The group message JSON models in the MP SDK have been updated to support new WeChat API capabilities. The base data model for sending by OpenId now includes an optional clientmsgid property for developer-side message tracking. News models for group messages now support need\_open\_comment and only\_fans\_can\_comment parameters to control comment settings. Send results now include a msg\_data\_id field for statistical analysis. Additionally, new models support retrieving group message speed settings and video media IDs for group messaging.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageJson · high confidence
HttpUtility refactoring: Native AOT-compatible Post parsing and OAuth URL generation
The HttpUtility module has been refactored to improve compatibility with modern .NET environments, specifically Native AOT and trimming. Post.cs now includes a new GetResult overload that accepts JsonTypeInfo, enabling serialization that works with source-generated System.Text.Json metadata required for Native AOT builds. UrlUtility.cs provides a GenerateOAuthCallbackUrl method that correctly constructs OAuth callback URLs by handling scheme, host, port, and base URL components, ensuring proper behavior in reverse proxy and sub-application scenarios. Get.cs remains as a structural placeholder for GET request handling within this utility namespace.
src/Senparc.Weixin/Senparc.Weixin/Utilities/HttpUtility · high confidence
Introduce .NET Core 3.0 compatibility and OAuth redirect improvements
The Senparc.Weixin.MP.MvcExtension library now supports .NET Core 3.0, introducing the \EnableRequestRewindMiddleware\ to handle request buffering (using \EnableBuffering\ instead of the deprecated \EnableRewind\) and updating the \SenparcOAuthAttribute\ to use permanent 301 redirects for OAuth flows. Additionally, the \WeixinInternalRequestAttribute\ and \BrowserUtility\ have been updated to work with the new ASP.NET Core context models, while the \SenparcOAuthAttribute\ now includes logic to prevent caching of sensitive pages during authorization.
src/Senparc.Weixin.MP.MvcExtension · high confidence
JSSDK signature logic updated to ASCII sort and async UI packages added
The JSSDK helper now uses ASCII dictionary sorting for parameter keys and values in signature generation (GetSignature, GetcardExtSign, CreateNonekeySha1) to comply with platform requirements, and introduces asynchronous UI package methods (GetJsSdkUiPackageAsync) alongside new data models (JsSdkUiPackage, JsSdkAddCardUiPackage) to simplify passing JSSDK configuration and card-add parameters to the frontend.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Helpers/JSSDK · high confidence
Local container cache strategy now supports asynchronous operations
The LocalContainerCacheStrategy implementation has been updated to include an asynchronous GetAllAsync method, allowing container cache retrieval to proceed without blocking the calling thread. This change, combined with the use of ConfigureAwait(false) in the underlying cache calls, helps prevent potential deadlocks in asynchronous contexts. The synchronous GetAll method remains available for existing code paths.
src/Senparc.Weixin/Senparc.Weixin/Cache.Local · high confidence
Memcached cache registration now uses IRegisterService
The Senparc.Weixin.Cache.Memcached package has been updated to align with the CO2NET registration system. The primary change is that the UseSenparcWeixinCacheMemcached() extension method now accepts an IRegisterService instead of IApplicationBuilder, requiring developers to register the Memcached cache through the unified registration service. Additionally, the internal cache activation method has been renamed from RegisterDomainCache() to ActivityDomainCache(), and the configuration file includes binding redirects for Enyim.Caching and Newtonsoft.Json to ensure compatibility.
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached · high confidence
Memcached container cache strategy now declares no capabilities and handles async updates conditionally
The Memcached container cache strategy now explicitly declares that it supports no advanced cache capabilities (Capabilities returns None). The synchronous UpdateContainerBag method has been updated to only perform an update if the key already exists in the cache (checked via TryGet), preventing creation of new entries. The asynchronous UpdateContainerBagAsync method mirrors this behavior, awaiting the underlying async update only if the key is present, while GetAll and GetAllAsync remain unsupported (throwing NotImplementedException).
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy · high confidence
Memcached dependency injection methods renamed and restricted to non-.NET 4.6.2 targets
The Memcached integration's dependency injection extension methods have been renamed and refactored. In the service collection extensions, the method is now named AddWeixinMemcached (replacing the previous AddSenparcMemcached), and in the application builder extensions, the middleware registration is exposed via UseSenparcMemcached. Both new extension classes are conditionally compiled with \#if !NET462, meaning these specific DI and middleware setup paths are only available for .NET Core and other frameworks excluding .NET Framework 4.6.2; for .NET 4.6.2, these methods are not included in the build.
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Inject · high confidence
New JSON result and serialization callback interfaces introduced
The SDK now exposes two new interfaces in the result entity layer: IJsonResult, which serves as a base contract for all JSON API responses and includes properties for error messages, error codes, P2P data, and detailed hints; and IJsonResultCallback, which provides hooks for custom logic during JSON serialization and deserialization (before/after serializing and before/after deserializing). This allows consumers to standardize result handling and inject custom behavior into the JSON processing pipeline.
src/Senparc.Weixin/Senparc.Weixin/Entities/JsonResult/Interface · high confidence
New OpenAPI quota and rid endpoints, stable token fix, and injectable API client
The MP module adds official OpenAPI endpoints for querying API call quotas (QuotaGet) and retrieving rid information (RidGet), along with their async counterparts, enabling developers to monitor usage limits and debug specific request errors. The CommonApi.GetStableAccessToken method is fixed to correctly pass the force\_refresh parameter instead of using a hardcoded value, ensuring stable token behavior works as intended. Additionally, a new MpApiClient class is introduced to provide an injectable, per-account API client that supports cancellation tokens, allowing DI containers to manage API instances without relying on static service locators.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs · high confidence
New global configuration and registration entry points for Senparc.Weixin
The library introduces a new \Config.cs\ class to centralize global settings, including debug modes, API host URLs for Official Accounts, Enterprise WeChat, and WeChat Pay, as well as cache namespace and timeout configurations. A new \WeixinRegister.cs\ provides the \UseSenparcWeixin()\ extension method, which simplifies SDK initialization by handling CO2NET global registration, automatic extension cache discovery (Redis, Memcached), and platform-specific setup. Additionally, \Enums.cs\ has been updated to include the \PlatformType\ enumeration and expanded \ReturnCode\ error codes for various WeChat platforms.
src/Senparc.Weixin/Senparc.Weixin · high confidence
OAuth API response models updated with new fields and deprecated properties
The OAuth JSON result models in the MP SDK have been updated to align with WeChat API changes. The \OAuthAccessTokenResult\ class now includes an \is\_snapshotuser\ property to indicate if the user is a snapshot-mode virtual account. The \OAuthUserInfo\ class has removed gender and location fields (sex, province, city, country), marking them as obsolete due to WeChat's privacy policy changes, while retaining other user details. Additionally, a new \RefreshTokenResult\ class has been introduced, inheriting from \OAuthAccessTokenResult\ to handle refresh token responses.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson · high confidence
Redis cache implementation now uses ServiceStack.Redis
The Redis cache strategy for the Weixin library has been updated to use the ServiceStack.Redis client library. This change introduces a new configuration model via \RedisConfigInfo\, allowing users to define read/write server lists, pool sizes, and local cache settings through standard .NET configuration sections. The underlying \RedisManager\ now initializes a \PooledRedisClientManager\ based on these settings, and \RedisContainerCacheStrategy\ implements the container caching interface using ServiceStack's typed client and hash operations.
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ServiceStack.Redis · high confidence
Redis cache registration now uses IRegisterService and CO2NET integration
The Senparc.Weixin.Cache.Redis package has been updated to integrate with Senparc.CO2NET, shifting the registration model to use the IRegisterService interface instead of the previous IApplicationBuilder. The new UseSenparcWeixinCacheRedis extension method allows developers to register Redis caching via a unified service registration pipeline, and the underlying domain cache activation is now handled through the ActivityDomainCache method which initializes the Redis container strategies.
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis · high confidence
Redis container cache strategy refactored with async support and new HashSet storage option
The Redis container cache implementation has been refactored to integrate with the Senparc.CO2NET base library, introducing asynchronous methods (e.g., GetAllAsync) for container bag retrieval to improve responsiveness. The default strategy now delegates to a refined underlying Redis object cache strategy, while a new RedisHashSetContainerCacheStrategy is introduced to store container information using Redis HashSets, offering an alternative storage format for better performance or compatibility.
src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/ContainerCacheStrategy · high confidence
Refactor WebSocket message handling to support .NET Framework 4.6.2 and .NET Core
The WebSocket message handling logic has been restructured to support both .NET Framework 4.6.2 and .NET Core (via SignalR). A new \ReceivedMessage\ entity is introduced to encapsulate incoming data, including message content, session ID, and form ID. The core message processing is now split into platform-specific implementations: \WebSocketHandler\_NET45.cs\ handles the .NET Framework 4.6.2 path using \IHttpHandler\ and \JavaScriptSerializer\, while \WebSocketHandler\_Core.cs\ and \WebSocketHandler\_Common.cs\ manage the .NET Core/SignalR path, utilizing \Newtonsoft.Json\ for deserialization. This change ensures consistent message handling across both target frameworks while adapting to their respective WebSocket and serialization APIs.
src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Routes/WebSocketHandler · high confidence
Refactor custom message API structure and add card extension support
The custom message API implementation has been reorganized: a new CardExt class is introduced to handle card-specific parameters (such as card\_id, code, and openid) for sending customer service cards, and the SendMenuContent class has been moved from the Entities namespace to the AdvancedAPIs/Custom namespace to better reflect its role as a parameter model for the SendMenu method. These changes streamline the structure of the CustomApi class while adding support for new WeChat customer service features like card sending and menu interaction content.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Custom · high confidence
Refactored API handler wrapper with improved error handling and retry logic
The \ApiHandlerWapperBase\ class has been refactored to provide a more robust foundation for API calls. Key changes include: 1) Enhanced error handling for configuration errors (e.g., unregistered AppId) and JSON result failures, with an option to throw exceptions or return error results based on \Config.ThrownWhenJsonResultFaild\. 2) Improved retry logic for invalid credentials, allowing multiple error codes to be specified for retry attempts. 3) Added specific handling for WeCom (Work) status codes to prevent false success responses when status code conversion fails. 4) The \ApiHandlerWapperFactory\ class is now commented out, indicating a shift away from its previous factory pattern approach in favor of the new base class structure.
src/Senparc.Weixin/Senparc.Weixin/CommonAPIs/ApiHandlerWapper · high confidence
Refactored WeChat MP event request entities to use a common base class
The event request entity classes in the \Senparc.Weixin.MP\ library have been restructured to inherit from a new \RequestMessageEventBase\ class. This base class implements the \IRequestMessageEventBase\ interface and standardizes the \MsgType\ and \Event\ properties across all event types, including menu clicks, subscriptions, location reporting, scanning, and mass-send job finishes. This change ensures consistent event type handling and simplifies the entity hierarchy for developers processing WeChat message events.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event · high confidence
Refactored WeChat MP request message entities to support NeuChar and interactive menus
The request message entity classes in the \Senparc.Weixin.MP\ library have been restructured to implement specific interfaces (such as \IRequestMessageText\, \IRequestMessageFile\, \IRequestMessageImage\, etc.) and integrate with the \Senparc.NeuChar\ framework. This change enables cross-platform message handling via NeuChar and adds support for interactive menu events, specifically by introducing the \bizmsgmenuid\ property to \RequestMessageText\ to identify user clicks on menu items. Additionally, the \PostModel\ class now exposes a \DomainId\ property to align with NeuChar's requirements.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request · high confidence
Refactored WeChat MP response message entities to use NeuChar types
The response message entity classes in the Senparc.Weixin.MP library (including Text, Image, Music, News, Video, Voice, and Customer Service Transfer) have been refactored to inherit from and utilize types from the Senparc.NeuChar library. This change aligns the MP SDK's response structures with the unified NeuChar entity model, replacing previous implementations with standardized interfaces and properties defined in the shared NeuChar.Entities namespace.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Response · high confidence
Refactored WeChat Official Account menu API implementation and logic fixes
The custom menu API implementation in the MP module has been restructured into dedicated partial classes (Common, Conditional, Custom) to improve code organization. This change includes specific bug fixes for secondary menu button logic (v16.18.2.1) and custom menu entity handling (v16.18.10.7), as well as the addition of support for new button types such as \article\_id\ (v16.18.1). The refactoring also consolidates JSON sending via \CommonJsonSend.Send\ and updates copyright headers to 2026.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/CommonAPIs/Menu · high confidence
Refactored WeChat Store API data models
The data models for the WeChat MP Store (Poi) API have been restructured to improve type safety and clarity. New dedicated classes have been introduced for request payloads (CreateStoreData, UpdateStoreData) and responses (PoiUploadImageResultJson, GetStoreResultJson, GetStoreListResultJson). Base information structures have been separated into StoreBaseInfo and StoreBaseInfoCanBeUpdate to distinguish between creation and update requirements, and the GetStoreList\_BaseInfo model has been expanded to include store status fields (available\_state, update\_status) as per API updates.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Poi/StoreJson · high confidence
Refactored WeChat configuration model into modular, multi-platform settings
The \SenparcWeixinSetting\ configuration system has been restructured to support multiple WeChat platforms (Official Accounts, Mini Programs, Enterprise WeChat, Open Platform, and TenPay V3) through a unified, extensible model. The main \SenparcWeixinSetting\ class now acts as a container with a \SenparcWeixinSettingItemCollection\ for managing multiple named configurations, and provides a convenient indexer (\setting\[key\]\) for quick access. Individual settings are handled by \SenparcWeixinSettingItem\, which implements specific interfaces (e.g., \ISenparcWeixinSettingForMP\, \ISenparcWeixinSettingForTenpayV3\) to expose platform-specific properties like \TenPayV3\_SubMchId\ and \TenPayV3\_WxOpenTenpayNotify\. This change simplifies configuration management by allowing developers to define and access settings for different WeChat services within a single, cohesive structure.
src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings · high confidence
Refactored WeChat message encryption and decryption for improved security and resource management
The Tencent message encryption module has been updated to use cryptographically secure random number generation for message padding, replacing the previous pseudo-random approach. Additionally, AES cryptographic resources are now properly disposed of using 'using' statements to prevent memory leaks, and SHA1 hash resources are similarly managed. These changes enhance the security posture and stability of message encryption/decryption operations for WeChat integration.
src/Senparc.Weixin/Senparc.Weixin/Tencent · high confidence
Refactored group message data models to support TagId and standardized filter-based sending
The group message JSON data classes have been restructured to support broadcasting by both GroupId and TagId. A new base class, BaseGroupMessageDataByFilter, now serves as the foundation for all filter-based message types, introducing the clientmsgid property for developer-side tracking and the send\_ignore\_reprint parameter to control reprint handling. The previous GroupId-specific classes (e.g., GroupMessageByGroupId, BaseGroupMessageDataByGroupId) are now marked as obsolete and inherit from this new base, while a new GroupMessageByTagId class enables filtering by tag. Content-specific classes (Voice, Image, Text, MpNews, MpVideo, WxCard) have been updated to use the new base structure and standardized media ID wrappers.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/GroupMessage/GroupMessageJson/ByFilter · high confidence
Refactoring of response message base class and interface
The \ResponseMessageBase\ class and \IResponseMessageBase\ interface have been removed from the \Senparc.Weixin.MP.Entities\ namespace. This change consolidates the \Content\ property into a common interface (as indicated by commit messages regarding \IResponseMessageBase\) and prepares the entity structure for supporting voice reception and music message sending, while also addressing a \CreateTime\ conversion bug.
Senparc.Weixin.MP/Senparc.Weixin.MP/Entities · medium confidence
ShakeAround API types and parameters updated for WeChat compatibility
The ShakeAroundApi implementation has been updated to align with WeChat's API changes, specifically adjusting the \lastSeen\ parameter in \SearchDeviceByApplyId\ and the \appId\ parameter in device application methods to use the \long\ data type instead of \int\. Additionally, the codebase now utilizes the \NcApiBind\ attribute for API binding and relies on the unified \CommonJsonSend.Send\<T\>()\ method for HTTP requests, ensuring consistent behavior across platforms.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/ShakeAround · high confidence
Shared sample project for static assets
The Senparc.Weixin.Sample.Shared location now includes a shared project structure (\.shproj\ and \.projitems\) that centralizes static web assets—such as CSS files, jQuery UI themes, and media—ensuring they are consistently copied to the output directory across consuming sample projects.
Samples/All/Senparc.Weixin.Sample.Shared · high confidence
Shared sample project structure and assets introduced
The sample application now utilizes a shared project to centralize common UI components and model classes. This change introduces shared views (such as error handling, footers, and sidebars), static assets (Bootstrap and jQuery libraries), and model classes (ErrorViewModel, SourceCodeViewModel) into the Senparc.Weixin.Sample.Shared location, allowing multiple sample projects to reuse these presentation and data elements.
Samples/Shared/Senparc.Weixin.Sample.Shared · high confidence
Simplified Weixin service registration with optimized certificate loading
The library now provides a new \AddSenparcWeixin\ extension method that streamlines the setup of Weixin services by automatically registering global CO2NET services and configuring settings from \IConfiguration\. This change introduces a performance optimization for TenPay V3 certificate loading: instead of blocking the main thread during service provider construction, the SDK reads certificate paths directly from the configuration section and loads them asynchronously or via a provided callback, significantly improving application startup speed. The existing \AddSenparcWeixinServices\ method is retained as an alias for backward compatibility.
src/Senparc.Weixin/Senparc.Weixin/RegisterServices · high confidence
Standardizes JSON result entities with a common base class and ErrorCodeValue property
The JSON result entity classes (WxJsonResult, QyJsonResult, and WorkJsonResult) now inherit from a new abstract base class, BaseJsonResult. This change introduces a standardized ErrorCodeValue property across all result types, allowing consumers to easily retrieve the numeric error code regardless of the specific platform (WeChat Official Account, Enterprise WeChat, or Enterprise Account). Additionally, the base class provides a Hints property for detailed error information and a P2PData property for custom payload handling, unifying the structure of API responses.
src/Senparc.Weixin/Senparc.Weixin/Entities/JsonResult · high confidence
Unified exception hierarchy and structured API error handling
The exception handling in the Weixin SDK has been restructured to provide a consistent base class and a modern result-based error model. All custom exceptions (such as ErrorJsonResultException, MessageHandlerException, WeixinMenuException, and WeixinNullReferenceException) now inherit from the new WeixinException, which itself derives from the CO2NET BaseException and includes an AccessTokenOrAppId property for easier debugging. Additionally, a new WeixinApiResult\<T\> type and WeixinApiExecutor utility allow developers to handle expected API failures (like validation or business errors) as structured results rather than exceptions, while WeixinObsoleteException is available to flag deprecated interface usage.
src/Senparc.Weixin/Senparc.Weixin/Exceptions · high confidence
Updated .NET Framework target to 4.6.2
The sample application has been upgraded from .NET Framework 4.5 to 4.6.2. This change aligns the project with a newer runtime version, ensuring compatibility with updated platform features and libraries.
Samples/All/net45-mvc/Senparc.Weixin.MP.Sample · high confidence
Updated sample app to Bootstrap 5.1.0
The sample application's static assets in the shared wwwroot folder have been updated to use Bootstrap 5.1.0. This includes the addition of the Bootstrap Grid CSS and source maps, along with a custom site.css that applies a new visual theme with specific styling for documentation elements, navigation menus, and code blocks.
Samples/Shared/Senparc.Weixin.Sample.Shared/wwwroot · high confidence
UrlUtility supports .NET Core via conditional compilation
The UrlUtility class in the Senparc.Weixin.AspNet.HttpUtility namespace now supports both .NET Framework 4.6.2 and .NET Core. The implementation uses conditional compilation (\#if NET462) to handle differences in HttpContext and Request APIs, allowing the OAuth callback URL generation to work correctly in ASP.NET Core environments alongside legacy .NET Framework applications.
src/Senparc.Weixin.AspNet/Utilities/HttpUtility · high confidence
User info API models updated to reflect WeChat platform deprecations and new fields
The JSON data models for the WeChat MP User API have been updated to align with current platform behavior. The \UserInfoJson\ class now marks the \nickname\, \sex\, \city\, \province\, \country\, and \headimgurl\ properties as obsolete, reflecting that WeChat no longer returns this data in user info responses. Additionally, the \qr\_scene\ property has been changed from an integer to \uint\ to support larger values, and the \subscribe\_scene\ field has been added to indicate the user's follow source. New model classes \ChangeOpenIdJsonResult\ and \OpenIdResultJson\ have been introduced to support account migration OpenID conversion and follower list retrieval, respectively.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/User/UserJson · high confidence
WeChat MP .NET Framework sample upgraded to 4.6.2
The .NET Framework sample in the Samples/All/net45-mvc directory has been updated from .NET Framework 4.5 to 4.6.2. The solution file and project structure now target this newer framework version, which will be supported until Microsoft ends support for it, with a planned future upgrade to .NET Framework 4.8. The sample remains compatible with Visual Studio 2019 and later.
Samples/All/net45-mvc · high confidence
WeChat MP Merchant APIs gain async methods and fix data types
The Merchant API layer (Express, Group, Order, Picture, and Product) now exposes asynchronous versions of its methods (e.g., AddExpressAsync, GetByIdOrderAsync, UploadImgAsync) using ConfigureAwait(false) to prevent potential deadlocks. Additionally, the Product API's data models have been updated to use string types for SKU and Property IDs (previously int) and bool flags in Attrext (previously int), aligning the SDK with the official WeChat API contract.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/MerChant · high confidence
WeChat Mini Program audit event classes deprecated in favor of WxOpen namespace
The \RequestMessageEvent\_WeAppAuditFail\ and \RequestMessageEvent\_WeAppAuditSuccess\ classes in the \Senparc.Weixin.MP\ namespace are now marked as obsolete. Users should migrate to the corresponding classes in the \Senparc.Weixin.WxOpen.Entities\ namespace to handle Mini Program audit failure and success events, aligning with the separation of Mini Program-specific logic from the main MP SDK.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Request/Event/WeApp · high confidence
WeChat Official Account Message Handler Refactoring and Event Support
The MessageHandler component in the WeChat Official Account SDK has been refactored to support the NeuChar cross-platform abstraction, introducing a new IMessageHandler interface and dedicated handler files for events and messages. This update adds support for specific WeChat events including menu clicks jumping to mini-programs (view\_miniprogram), store mini-program audit notifications, and subscription message status changes. Additionally, the handler now enforces stricter security by allowing encrypted-only message processing via the onlyAllowEncryptMessage flag, optimizes message deduplication logic, and limits message context capacity to improve performance and stability.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageHandlers · high confidence
WeChat Official Account menu button types now use Senparc.NeuChar
The menu button entity classes in the MP SDK (including SingleClickButton, SingleViewButton, SingleMiniProgramButton, SingleMediaIdButton, and others) have been refactored to use the unified button type enumeration from the Senparc.NeuChar library (MenuButtonType) instead of a local definition. This change centralizes button type handling across Senparc's platforms. Additionally, new button types for article\_id and article\_view\_limited have been added to support WeChat's draft article features, while the older media\_id and view\_limited buttons are marked as obsolete to encourage migration to the new article-based types.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/Entities/Menu/Buttons · high confidence
WeChat QR Code API now supports string-based scene IDs for temporary codes
The QrCode API in the WeChat MP SDK has been updated to support the QR\_STR\_SCENE action type, allowing developers to create temporary QR codes using string-based scene identifiers (up to 64 characters) instead of numeric IDs. This change aligns with the latest WeChat official documentation and enables more flexible scene identification for temporary QR codes, which previously only supported numeric scene IDs.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/QrCode · high confidence
WeChat WiFi API implementation updated with NcApiBind and copyright refresh
The WeChat WiFi API module has been updated to use the new NcApiBind attribute for platform binding and includes refreshed copyright headers (2026). The implementation continues to provide synchronous methods for managing WeChat WiFi shops and devices, such as listing shops, querying shop details, updating network information, cleaning devices, and adding new devices.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/WiFi · medium confidence
WebSocketHelper adapts to .NET Framework 4.6.2 and .NET Core/SignalR
The WebSocketHelper class now uses conditional compilation to support both .NET Framework 4.6.2 and .NET Core/SignalR environments. In .NET Framework 4.6.2, it interacts directly with System.Net.WebSockets.WebSocket, while in .NET Core, it uses SenparcWebSocketHubBase and requires an IClientProxy for message sending. Both paths now use ConfigureAwait(false) to prevent potential async deadlocks.
src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Helpers · high confidence
WiFi API response models updated to support Mini Program navigation
The JSON response models for the WeChat MP WiFi API have been updated to reflect changes in the official API, specifically to support navigation to Mini Programs from the WiFi connection page. New or modified classes in the \Senparc.Weixin.MP.AdvancedAPIs.WiFi\ namespace now include fields for Mini Program identifiers and paths, such as \homepage\_wxa\_user\_name\ and \homepage\_wxa\_path\ in the shop details result, and \finishpage\_wxa\_user\_name\, \finishpage\_wxa\_path\, and \finishpage\_type\ in the shop information result. This allows developers to configure the WiFi connection flow to redirect users to specific Mini Program pages instead of just H5 URLs.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/WiFi/WiFiJson · high confidence
Fixes
Improved robustness of WeChat message event parsing in DefaultMpMessageContext
The DefaultMpMessageContext now handles cases where the WeChat event type is stored as a numeric value or missing in cached data. This prevents null reference exceptions when restoring message context, ensuring smoother operation for applications relying on cached message states.
src/Senparc.Weixin.MP/Senparc.Weixin.MP/MessageContexts · high confidence
Test coverage
Added Native AOT smoke test and dedicated test run settings; Added NeuChar test configuration data; Added test project assembly metadata; Added unit test for TenPayV3 order query; Added unit tests for CommonAPIs menu operations and API wrapper handling; Added unit tests for CsRedis cache strategy; Added unit tests for HttpUtility.Get.Download; Added unit tests for InvokeWeixinApiHelper; Added unit tests for JSSDKHelper signature methods; Added unit tests for MP Container registration and token retrieval; Added unit tests for MP helper utilities; Added unit tests for MP message context JSON conversion and event mapping; Added unit tests for MP message handling and signature verification; Added unit tests for MP response message parsing and creation; Added unit tests for MessageAgent; Added unit tests for OpenAPI quota and rid queries; Added unit tests for Redis container cache strategy; Added unit tests for RequestUtility HTTP methods; Added unit tests for Senparc.Weixin.Open API contracts and containers; Added unit tests for TenPay V2 and V3 payment APIs; Added unit tests for TenPayLibV3 utilities and request handling; Added unit tests for WeChat MP Advanced APIs; Added unit tests for WeChat MP MessageHandlers; Added unit tests for WeChat MP message handler entities; Added unit tests for WeChat Work Advanced API contracts; Added unit tests for local cache deadlock scenarios; Added unit tests for the MP MessageHandler middleware; Initial test project and V2 payment handler scaffolding; Migrated unit tests to new project structure with enhanced coverage; Removed obsolete unit tests for EntityHelper and RequestMessageFactory.
Dependencies
Sample projects updated to .NET 10.0 with latest Senparc dependencies
The sample projects in the \Samples/All\ directory have been updated to target .NET 10.0 (e.g., \Senparc.Weixin.Sample.Net10\, \Senparc.Weixin.Net10Sample.CommonService\). These projects now reference the latest stable versions of the Senparc SDK components, including Senparc.Weixin (6.25.1), Senparc.Weixin.MP (16.25.3), Senparc.Weixin.TenPayV3 (2.6.1), and Senparc.NeuChar (3.0.0), ensuring compatibility with the newest WeChat API features and runtime capabilities.
(dependencies) · high confidence
Housekeeping
Removal of ReSharper project-specific cache and state files
The ReSharper-specific configuration directory for the Senparc.Weixin.MP project has been removed. This includes the deletion of internal cache files (such as BuildScriptCache, ConditionalNames, GeneratedFiles, JavaScriptCache, MvcAnnotations, NamedArguments, and PersistentCaches), the ModuleIds.xml registry, and the RecentItems history (RecentFiles.dat). These changes clean up local IDE state and cache data that are specific to the ReSharper tooling environment.
_Senparc.Weixin.MP/\ReSharper.Senparc.Weixin.MP · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 44.
Lenses
- Code Health 38
- Architecture 98
- Maturity 66
- Readiness 46
- Security 43
- Accessibility 65
- Performance 55
Changes since last survey
- 300 commits — 244 feature/other, 56 fixes
By area
- (repo) — 129 commits
- src/Senparc.Weixin.TenPay — 29 commits
- src/Senparc.Weixin.Work — 28 commits
- Samples/All — 21 commits
- src/Senparc.Weixin.WxOpen — 18 commits
- (root) — 17 commits
- src/Senparc.Weixin.Open — 15 commits
- src/Senparc.Weixin.All — 14 commits
- src/Senparc.Weixin.MP — 7 commits
- src/Senparc.Weixin.Cache — 5 commits
- Samples with AI/readme.md — 2 commits
- Samples/MP — 2 commits
- Samples/TenPayV3 — 2 commits
- Samples/WxOpen — 2 commits
- src/Senparc.Weixin — 2 commits
- tools/WeixinDev — 2 commits
- docs/NET9_CERTIFICATE_COMPATIBILITY.md — 1 commit
- docs/PerformanceBestPractices.md — 1 commit
- docs/PerformanceOptimizationSummary-CN.md — 1 commit
- eng/ApiCompat — 1 commit
Notable commits
- fix: Add .NET 9.0 compatibility fixes for SSL certificate loading in TenPayV3 refund operations
- fix: Add documentation and version history for Detail.value property fix
- fix: Bump version to 2.4.0 and document TenPayNotifyHandler body reading fix
- fix: Fix BasePayApis configuration issue in ProfitsharingApis
- fix: Fix SendFile API parameter format to match official documentation
- fix: Fix Swagger schemaId conflicts by renaming nested classes
- fix: Fix TenPayNotifyHandler stream reading bug to allow middleware reuse
- fix: Fix code review issues: correct key generation and log message consistency
- fix: Fix copyright header creation dates to match actual file creation date (20251202)
- fix: Fix creator identifiers (Copilot→Senparc), update Work v3.31.0 and All v2026.6.8 with release notes
- fix: Fix critical performance bottlenecks: Remove Task.WaitAll blocking and defer expensive initialization
- fix: Fix version number inconsistency: update to 2.3.3-preview.1
- fix: Fix: Correct file upload dictionary format in MediaApi
- fix: Merge branch 'Developer' into copilot/fix-tenpay-notify-handler-bug
- fix: Merge branch 'master' into copilot/fix-file-upload-api-issue
- fix: Merge pull request #3189 from JeffreySu/copilot/fix-0e097dbc-6b20-45c1-b97d-7d5f50d2f231
- fix: Merge pull request #3190 from JeffreySu/copilot/fix-374bc3ae-9724-4c66-b820-c949965a463b
- fix: Merge pull request #3206 from JeffreySu/copilot/fix-swagger-api-issue
- fix: Merge pull request #3219 from JeffreySu/copilot/fix-wechat-pay-error
- fix: Merge pull request #3222 from JeffreySu/copilot/fix-tenpay-notify-handler-bug
- …and 280 more
API surface
- 3 HTTP endpoints (baseline)
Architecture
- 7 containers · 0 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
JeffreySu/WeiXinMPSDK was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit be573f6f94bdbf718dd5f6cdecb137fbc7ff651e — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.