C# SDK with .NET Core Support July 15, 2024 15:58 Updated Index: Migrating from the old SDK Type mapping Method mapping Running Last week, we released a new version of the BLiP C# SDK, which allows the construction of multi-platform C# applications (Windows, Linux, and Mac) that can be easily hosted in the cloud, including in Docker containers. This is possible thanks to the portability of .NET Core on which it is based. Check out the BLiP documentation to learn how to get started using it. Migrating from the old SDK To migrate a chatbot that uses the old version of the SDK (based on the Blip.MessagingHub.Client package), you need to follow these steps: Create a project using the BLiP template, using the command dotnet new blip-console (as described in the right-hand side menu in the C# SDK section of the BLiP documentation). Copy the classes and the application.json file to the new project and install the other dependencies (except the BLiP SDK, which is already installed in the template). Replace the names of the old interfaces and classes with the new SDK (mapped below). Adjust the method calls with altered signatures (mapped below). It is not possible to reuse the old projects, as they are based on the old version of .csproj from .NET, which is incompatible with .NET Standard / .NET Core projects used in the new BLiP SDK. Type mapping Old: Takenet.MessagingHub.Client.Sender.IMessagingHubSender New: Blip.Client.ISender Old: Takenet.MessagingHub.Client.Listener.IMessageReceiver New: Blip.Client.IMessageReceiver Old: Takenet.MessagingHub.Client.Listener.INotificationReceiver New: Blip.Client.INotificationReceiver Old: Takenet.MessagingHub.Client.Listener.ICommandReceiver New: Blip.Client.ICommandReceiver Old: Takenet.MessagingHub.Client.IMessagingHubClient New: Blip.Client.IBlipClient Old: Takenet.MessagingHub.Client.MessagingHubClientBuilder New: Blip.Client.BlipClientBuilder Old: Takenet.MessagingHub.Client.Host.* New: Blip.Client.Activation.* Antigo: Takenet.MessagingHub.Client.Extensions.* New: Blip.Client.Extensions.* Old: Takenet.MessagingHub.Client.Listener.* New: Blip.Client.Receivers.* Method mapping Old: IMessagingHubSender.SendCommandAsync(Command) New: Blip.Client.ISender.ProcessCommandAsync(Command, CancellationToken) Old: IMessagingHubSender.SendCommandResponseAsync(Command) New: Blip.Client.ISender.SendCommandAsync(Command, CancellationToken) Note: In most methods of the new version, it is mandatory to provide a cancellationToken to ensure the proper cancellation of asynchronous operations and avoid process freezing. In this case, always pass the received cancellationToken in the receivers. Running Note: In most methods of the new version, it is mandatory to provide a cancellationToken to ensure the proper cancellation of asynchronous operations and avoid process freezing. In this case, always pass the received cancellationToken to the receivers. But if you want your chatbot to still be a Class library for any reason, use the blip-console template when creating the project and change it to a Class library. To run the chatbot in this case, another project will be needed as a host. For more information, check out the discussion on this topic in our community or the videos on our channel. 😃 Related articles How to send WhatsApp notifications through Blip API How to build bots using SDKs or HTTP API [C# SDK] Creating a Content Distribution List How to create blocks in Builder How to Send SMS via API