Skip to content

Decouple Compat from new Teams Apps#391

Open
rido-min wants to merge 5 commits intonext/corefrom
next/core-decouple-fe
Open

Decouple Compat from new Teams Apps#391
rido-min wants to merge 5 commits intonext/corefrom
next/core-decouple-fe

Conversation

@rido-min
Copy link
Copy Markdown
Member

@rido-min rido-min commented Mar 25, 2026

This PR removes the dependency from Compat to TeamsApps, so we can decouple the release date of Core/Compat from PA, from the FE release.

  • Updates Compat Hosting to Add BotApplication instead of TeamsBotApplication
  • Updates CompatTeamsInfo to call each rest endpoint though the ConversationClient.BotHttpClient Instance
  • Remove some conversion from Core->Compat by using the proper generic in the REST call

This pull request primarily migrates code from using the legacy TeamsBotApplication and related types in the Microsoft.Teams.Bot.Apps namespace to the newer BotApplication and types from Microsoft.Teams.Bot.Core. It also removes or updates compatibility methods that referenced the old schema, and modernizes dependency registration and usage throughout the codebase. Additionally, there are improvements to the handling of Teams channel account conversions and group conversation logic in the sample bots.

Migration to Bot Core and Cleanup:

  • Replaced all references to TeamsBotApplication with BotApplication and updated constructor parameters and dependency injection registrations accordingly in CompatAdapter, CompatBotAdapter, AdapterWithErrorHandler, and related files. ([[1]](https://github.com/microsoft/teams.net/pull/391/files#diff-e6d701ce121dda6651c0dea00498d45e2cc0b0cec446a578f3058be691c7c0f5L26-R25), [[2]](https://github.com/microsoft/teams.net/pull/391/files#diff-e6d701ce121dda6651c0dea00498d45e2cc0b0cec446a578f3058be691c7c0f5L35-R34), [[3]](https://github.com/microsoft/teams.net/pull/391/files#diff-c443812ac75b10f0cb9e0929a1165dee72b7c96adbd232d830a65348ccd1b42bL28-R32), [[4]](https://github.com/microsoft/teams.net/pull/391/files#diff-e5922e6d5c7613f25aefa88e9c33d5a6c34be42d4353354e5f0e36f1715a0290L8-R16), [[5]](https://github.com/microsoft/teams.net/pull/391/files#diff-cb614beeb934fbb598ccac80c19a12a440f301b38b67b0e2796e861754fe59caL274-R280), [[6]](https://github.com/microsoft/teams.net/pull/391/files#diff-4a8e01c7cbf79ebf85f84bb4bef8cf1d3b02dc8a5875df6e9b34ac819fb7f80fL20-R20))
  • Updated all using statements and type references from Microsoft.Teams.Bot.Apps and Microsoft.Teams.Bot.Apps.Schema to Microsoft.Teams.Bot.Core and Microsoft.Teams.Bot.Core.Schema as appropriate. ([[1]](https://github.com/microsoft/teams.net/pull/391/files#diff-b9be640e365d9187b0d1a2021dddb84311b737f8c28b16428e3b2a450a4f331aL8-R11), [[2]](https://github.com/microsoft/teams.net/pull/391/files#diff-92ebcca71bdaad244e949c815cbf1152d5a3d814cc007052ae7ad2dd8ab225a9L8), [[3]](https://github.com/microsoft/teams.net/pull/391/files#diff-e6d701ce121dda6651c0dea00498d45e2cc0b0cec446a578f3058be691c7c0f5L9), [[4]](https://github.com/microsoft/teams.net/pull/391/files#diff-c443812ac75b10f0cb9e0929a1165dee72b7c96adbd232d830a65348ccd1b42bL9), [[5]](https://github.com/microsoft/teams.net/pull/391/files#diff-0317e1008e12e306d92289bc421d83933ace0400793ed8ad8abf13b03b68511eL7-R7))

Dependency Injection and Service Registration:

  • Changed service registration in InitCompatAdapter.cs and CompatHostingExtensions.cs to use AddBotApplication instead of AddTeamsBotApplication, and updated singleton registrations to use BotApplication. ([[1]](https://github.com/microsoft/teams.net/pull/391/files#diff-cb614beeb934fbb598ccac80c19a12a440f301b38b67b0e2796e861754fe59caL274-R280), [[2]](https://github.com/microsoft/teams.net/pull/391/files#diff-0317e1008e12e306d92289bc421d83933ace0400793ed8ad8abf13b03b68511eL45-R45))

Schema and Compatibility Layer Updates:

  • Updated compatibility methods to use ConversationAccount from the new core schema instead of legacy types, including the conversion logic for Teams channel accounts. ([[1]](https://github.com/microsoft/teams.net/pull/391/files#diff-2b447b715e5c577302421ca232985ced9354b64def7b26219525758928d097daL427-L435), [[2]](https://github.com/microsoft/teams.net/pull/391/files#diff-92ebcca71bdaad244e949c815cbf1152d5a3d814cc007052ae7ad2dd8ab225a9L118-L204))
  • Removed legacy compatibility methods for meeting info, meeting participants, and channel info that referenced deprecated types. ([core/src/Microsoft.Teams.Bot.Compat/CompatActivity.csL118-L204](https://github.com/microsoft/teams.net/pull/391/files#diff-92ebcca71bdaad244e949c815cbf1152d5a3d814cc007052ae7ad2dd8ab225a9L118-L204))

Bot Sample Improvements:

  • Enhanced the EchoBot sample to fetch and echo the user's display name, and in group conversations, to retrieve and display team details and paged member names using the new compatibility APIs. ([core/samples/CompatBot/EchoBot.csL37-R79](https://github.com/microsoft/teams.net/pull/391/files#diff-b9be640e365d9187b0d1a2021dddb84311b737f8c28b16428e3b2a450a4f331aL37-R79))

Miscellaneous:

  • Added missing System.Text.Json.Serialization using directive in CompatTeamsInfo.Models.cs. ([core/src/Microsoft.Teams.Bot.Compat/CompatTeamsInfo.Models.csR4](https://github.com/microsoft/teams.net/pull/391/files#diff-b1e303edd8e27c1011150ab48fe66a5de7f2e8ff54a6850a87efc57bcbd46583R4))

These changes modernize the codebase, improve maintainability, and ensure compatibility with the latest Teams Bot SDK core components.

Replaced all usage of Microsoft.Teams.Bot.Apps with Microsoft.Teams.Bot.Core, including updating dependency injection, using statements, and type references (e.g., TeamsBotApplication → BotApplication). Commented out or replaced App-specific TeamsInfo, meeting, and batch messaging APIs with Core-based or direct HTTP implementations. Updated project references and internal visibility accordingly. EchoBot and related adapters now use Core types, and group conversation handling includes additional debug output. This migration simplifies dependencies and prepares the codebase for future extensibility.
@rido-min rido-min requested a review from singhk97 March 25, 2026 06:06
@rido-min rido-min added the CORE label Mar 25, 2026
@rido-min rido-min requested a review from MehakBindra March 25, 2026 06:11
Replaced all usage of Microsoft.Teams.Bot.Apps with Microsoft.Teams.Bot.Core, including updating dependency injection, using statements, and type references (e.g., TeamsBotApplication → BotApplication). Commented out or replaced App-specific TeamsInfo, meeting, and batch messaging APIs with Core-based or direct HTTP implementations. Updated project references and internal visibility accordingly. EchoBot and related adapters now use Core types, and group conversation handling includes additional debug output. This migration simplifies dependencies and prepares the codebase for future extensibility.
Reformat SuggestedActions construction for clarity in help handler, reorder using directives for consistency, fix minor formatting in EchoBot.cs, and add MessageActivity_WithSuggestedActions unit test.
Copy link
Copy Markdown
Collaborator

@singhk97 singhk97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants