Soenneker.MsTeams.Util 11.0.1367

Prefix Reserved
dotnet add package Soenneker.MsTeams.Util --version 11.0.1367
                    
NuGet\Install-Package Soenneker.MsTeams.Util -Version 11.0.1367
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.MsTeams.Util" Version="11.0.1367" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.MsTeams.Util" Version="11.0.1367" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.MsTeams.Util" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.MsTeams.Util --version 11.0.1367
                    
#r "nuget: Soenneker.MsTeams.Util, 11.0.1367"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.MsTeams.Util@11.0.1367
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.MsTeams.Util&version=11.0.1367
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.MsTeams.Util&version=11.0.1367
                    
Install as a Cake Tool

Soenneker.MsTeams.Util

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Builds Adaptive Cards for common notifications and either sends them directly to Teams or places a MsTeamsMessage on Service Bus.

Installation

dotnet add package Soenneker.MsTeams.Util

Configuration

{
  "Environment": "Local",
  "MsTeams": {
    "UseQueue": false,
    "Enabled": true,
    "Errors": {
      "Enabled": true,
      "WebhookUrl": "https://example.webhook.office.com/webhookb2/..."
    }
  }
}

Each channel needs an Enabled setting. Direct sending also needs the sender's global MsTeams:Enabled switch and an absolute HTTPS WebhookUrl. Channel names cannot contain :. Keep webhook URLs in a secret provider.

MsTeams:UseQueue and per-channel Enabled values respond to configuration reloads. Environment is read when the utility is constructed; skipLocal suppresses a send only when that value is Local.

Registration

using Soenneker.MsTeams.Util.Registrars;

builder.Services.AddMsTeamsUtilAsScoped();
// or: builder.Services.AddMsTeamsUtilAsSingleton();

The scoped registration keeps the Teams sender and its underlying HTTP client infrastructure singleton while allowing the higher-level utility and its other scoped dependencies to be disposed with the scope.

Send a notification

using Soenneker.MsTeams.Util.Abstract;

await teams.SendMessage(
    title: "Import completed",
    channel: "Errors",
    summary: "Customer import finished with warnings",
    facts: new Dictionary<string, string?>
    {
        ["Imported"] = importedCount.ToString(),
        ["Rejected"] = rejectedCount.ToString()
    },
    skipLocal: true,
    cancellationToken: cancellationToken);

The exception overload defaults to the Errors channel and the title Exception thrown. SendMessage<T> builds a table from a list, while SendMessageCard accepts an already-built AdaptiveCard.

When UseQueue is false, successful completion means the Teams webhook accepted the card; a rejected send throws InvalidOperationException. When UseQueue is true, successful completion means Service Bus accepted the message, not that Teams delivered it. Disabled channels and skipLocal return without sending.

Exception details, facts, table values, summaries, and additional body text become card content. Remove credentials and personal data before calling these APIs, and account for duplicate notifications if queue delivery is retried.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Soenneker.MsTeams.Util:

Package Downloads
Soenneker.Alerter.Util

A utility library for alert related operations and abstraction over other notification services

Soenneker.Coordinators.Alerts

Handling Azure alerts from the controller

Soenneker.Runners.Runner

An abstract task runner with methods that typically are executed on some type of schedule.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1367 0 11/15/2026
11.0.1366 0 11/15/2026
11.0.1364 56 11/14/2026
11.0.1363 134 11/12/2026
11.0.1362 91 11/12/2026
11.0.1361 92 11/11/2026
11.0.1360 72 11/11/2026
11.0.1359 90 11/11/2026
11.0.1356 65 11/11/2026
11.0.1355 65 11/11/2026
11.0.1354 62 11/11/2026
11.0.1352 73 11/11/2026
11.0.1351 59 11/11/2026
11.0.1350 77 11/11/2026
11.0.1349 91 11/11/2026
11.0.1347 55 11/11/2026
11.0.1346 51 11/11/2026
11.0.1345 91 11/11/2026
11.0.1343 66 11/11/2026
11.0.1342 583 11/3/2026
Loading failed

Update dependency Soenneker.MsTeams.Sender to 11.0.1101 (#1876)