microsoft/teams.net v2.0.6
microsoft/teams.net
Captured source
source ↗v2.0.6
Repository: microsoft/teams.net
Tag: v2.0.6
Published: 2026-04-02T19:32:24Z
Prerelease: no
Release notes:
New Features
CancellationToken Support
- All async methods now accept optional
CancellationTokenparameters (fully backwards-compatible)
Targeted Messages (Preview) - ExperimentalTeamsTargeted
- Send messages visible only to specific recipients:
activity.WithRecipient(account, isTargeted: true)
Reactions (Preview) - ExperimentalTeamsReactions
- New
ReactionClientfor bot-to-user reactions with expanded reaction types
Sign-in Failure Handling
- New
signin/failureinvoke handling with actionable logging viaapp.OnSignInFailure()
Breaking Changes
1. `GetParticipantAsync` - Now requires tenantId parameter 2. `MeetingParticipant` - Model restructured (removed Id, Role, IsOrganizer, JoinTime; added Meeting, Conversation) 3. `App.Id` - Now nullable 4. `Activity.Value` - Refactored for proper type hierarchy access
Deprecations
- Teams Controllers - Marked
[Obsolete], migrate to Minimal APIs (seeDeprecated.Controllerssample) - Handlers without CancellationToken - Marked
[Obsolete], update handler signatures - `MessageReactionActivity.AddReaction()/.RemoveReaction()` - Marked
[Obsolete], useReactionClientinstead
Fixes
- Meeting activity deserialization for Teams PascalCase payloads
- UserAgent version accuracy
- GetParticipantAsync signature and data structure
Updates
- Package: System.IdentityModel.Tokens.Jwt v8.16.0
- Samples: Updated to Minimal APIs and Local environment
- New Samples: Reactions, TargetedMessages, Deprecated.Controllers
Migration
Opt-in to preview features:
$(NoWarn);ExperimentalTeamsReactions;ExperimentalTeamsTargeted
Controllers → Minimal APIs:
Before (Deprecated):
[TeamsController]
public class MainController : MessageController
{
[OnMessage]
public Task OnMessage() { ... }
}After:
teams.OnMessage(async (context, cancellationToken) =>
{
await context.Send("Hello!");
});Add CancellationToken:
Before (Obsolete):
teams.OnMessage(async (context) => { ... });After:
teams.OnMessage(async (context, cancellationToken) => { ... });Targeted Messages:
Before:
activity.WithTargetedRecipient(userId);
After:
activity.WithRecipient(account, isTargeted: true);
Reactions:
Before:
messageReactionActivity.AddReaction(reaction);
After:
await context.Api.Conversations.Reactions.CreateAsync( conversationId, activityId, reaction );
Appendix (PRs merged)
- Fix meeting activity deserialization for Teams PascalCase payloads by @Copilot in https://github.com/microsoft/teams.net/pull/198
- Update samples to minimal apis by @rido-min in https://github.com/microsoft/teams.net/pull/220
- Update samples to use Local environment by @rido-min in https://github.com/microsoft/teams.net/pull/273
- Update UserAgent to use AssemblyFileVersion by @rido-min in https://github.com/microsoft/teams.net/pull/238
- Fix GetParticipantAsync by @rido-min in https://github.com/microsoft/teams.net/pull/277
- Bump main to v2.0.6-preview by @singhk97 in https://github.com/microsoft/teams.net/pull/278
- Deprecate Teams Controllers by @rido-min in https://github.com/microsoft/teams.net/pull/281
- Update pipelines by @singhk97 in https://github.com/microsoft/teams.net/pull/291
- Revert Targeted Messages support (PR #195 and #222) by @ShanmathiMayuramKrithivasan in https://github.com/microsoft/teams.net/pull/290
- Add support for Targeted Messages by @ShanmathiMayuramKrithivasan in https://github.com/microsoft/teams.net/pull/303
- Add missing cancellation tokens by @rido-min in https://github.com/microsoft/teams.net/pull/317
- Create preview publish script for ADO by @corinagum in https://github.com/microsoft/teams.net/pull/323
- Git Ignore launchSettings and appsettings.Development by @rido-min in https://github.com/microsoft/teams.net/pull/298
- Simplify TargetedMessages with an overload in WithRecipient() by @rido-min in https://github.com/microsoft/teams.net/pull/318
- Make App.Id nullable instead of required by @rido-min in https://github.com/microsoft/teams.net/pull/348
- [Fix]: sync invoke activity Value property to base for access across type hierarchy by @MehakBindra in https://github.com/microsoft/teams.net/pull/340
- Add Reactions Feature (Bot to User) by @rido-min in https://github.com/microsoft/teams.net/pull/335
- Feat: add signin/failure invoke handling by @corinagum in https://github.com/microsoft/teams.net/pull/347
- Rename
OnFailureActivitytoOnSignInFailureActivityby @corinagum in https://github.com/microsoft/teams.net/pull/364 - Mark targeted messages and reactions as preview by @corinagum in https://github.com/microsoft/teams.net/pull/363
- Update CodeQL workflow to include 'next/core' branch by @singhk97 in https://github.com/microsoft/teams.net/pull/375
- Update Jwt package to v8.16.0 in Teams projects by @rido-min in https://github.com/microsoft/teams.net/pull/372
- Move IsTargeted property from Activity to Account by @ShanmathiMayuramKrithivasan in https://github.com/microsoft/teams.net/pull/365
- Add per-call CancellationToken to async client methods by @Copilot in https://github.com/microsoft/teams.net/pull/395
- Add [Obsolete] shims for non-cancellation token handlers by @rido-min in https://github.com/microsoft/teams.net/pull/405
- chore: migrate publish.yml pipeline to 1ES template by @singhk97 in https://github.com/microsoft/teams.net/pull/404
- fix: pipeline fixes after testing by @singhk97 in https://github.com/microsoft/teams.net/pull/409
- fix: pipelines - add publish credentials by @singhk97 in https://github.com/microsoft/teams.net/pull/411
- chore: Add default params to cancellation token for backwards compatibility by @singhk97 in https://github.com/microsoft/teams.net/pull/412
---
Full Changelog: https://github.com/microsoft/teams.net/compare/v2.0.5...v2.0.6