Cake.MicrosoftTeams
6.0.0
dotnet add package Cake.MicrosoftTeams --version 6.0.0
NuGet\Install-Package Cake.MicrosoftTeams -Version 6.0.0
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="Cake.MicrosoftTeams" Version="6.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cake.MicrosoftTeams" Version="6.0.0" />
<PackageReference Include="Cake.MicrosoftTeams" />
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 Cake.MicrosoftTeams --version 6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Cake.MicrosoftTeams, 6.0.0"
#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 Cake.MicrosoftTeams@6.0.0
#: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=Cake.MicrosoftTeams&version=6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Cake Microsoft Teams
Cake addin that provides Microsoft Teams aliases
Usage
Simple message
#addin nuget:?package=Cake.MicrosoftTeams
System.Net.HttpStatusCode result = MicrosoftTeamsPostMessage("Hello from Cake!",
new MicrosoftTeamsSettings {
IncomingWebhookUrl = EnvironmentVariable("MicrosoftTeamsWebHook")
});
Advanced message
#addin nuget:?package=Cake.MicrosoftTeams
var messageCard = new MicrosoftTeamsMessageCard {
summary = "Cake posted message using Cake.MicrosoftTeams",
title ="Cake Microsoft Teams",
sections = new []{
new MicrosoftTeamsMessageSection{
activityTitle = "Cake posted message",
activitySubtitle = "using Cake.MicrosoftTeams",
activityText = "Here is the runtime Information",
activityImage = "https://raw.githubusercontent.com/cake-build/graphics/master/png/cake-small.png",
facts = new [] {
new MicrosoftTeamsMessageFacts { name ="CakeVersion", value = Context.Environment.Runtime.CakeVersion.ToString() },
new MicrosoftTeamsMessageFacts { name ="TargetFramework", value = Context.Environment.Runtime.BuiltFramework.ToString() },
new MicrosoftTeamsMessageFacts { name ="IsCoreClr", value = Context.Environment.Runtime.IsCoreClr.ToString() }
},
}
},
potentialAction = new [] {
new MicrosoftTeamsMessagePotentialAction {
name = "View in Trello",
target = new []{"https://trello.com/c/1101/"}
}
}
};
System.Net.HttpStatusCode result = MicrosoftTeamsPostMessage(messageCard,
new MicrosoftTeamsSettings {
IncomingWebhookUrl = EnvironmentVariable("MicrosoftTeamsWebHook")
});
Return values
| Response Code | Details |
|---|---|
| OK (200) | A well-formed request is sent to an existing webhook. The request contains a valid payload, and has a valid corresponding webhook configuration. |
| BadRequest (400) | An incorrectly-formed request is sent to a webhook that exists. The payload could contain non-parseable JSON, incorrect JSON values (e.g. expected a String, got an array), incorrect content-type, etc.. |
| NotFound (404) | A request is sent to a webhook that does not exist. |
| RequestEntityTooLarge (413) | A request is sent to a webhook that is too large in size for processing. |
| 429 (429) | Client is sending too many requests and Office 365 is throttling the requests to a webhook. |
Discussion
For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.0 | 2,018 | 12/11/2025 |
| 5.0.0 | 410 | 12/11/2025 |
| 4.0.0 | 416 | 12/11/2025 |
| 3.0.0 | 425 | 12/11/2025 |
| 2.0.0 | 81,200 | 12/11/2021 |
| 1.3.0 | 697 | 12/11/2021 |
| 1.0.1 | 102,379 | 3/12/2021 |
| 1.0.0 | 115,613 | 2/9/2021 |
| 0.9.0 | 28,354 | 4/23/2019 |
| 0.8.0 | 39,297 | 10/30/2018 |
| 0.7.0 | 5,235 | 3/1/2018 |
| 0.6.0 | 5,031 | 10/16/2017 |
| 0.5.0 | 1,309 | 10/16/2017 |
| 0.4.0 | 3,778 | 6/22/2017 |
| 0.3.0 | 4,373 | 11/11/2016 |
| 0.2.0-alpha | 1,830 | 11/3/2016 |
| 0.1.2-Alpha | 1,677 | 11/3/2016 |
| 0.1.1-Alpha | 2,370 | 11/3/2016 |
| 0.1.0-Alpha | 1,665 | 11/3/2016 |