Share via

TeamsFX bot stopped working (NullReferenceException on proactive messaging) - clarification on deprecation vs platform changes

JürgenH 0 Reputation points
2026-02-09T07:18:22.25+00:00

Hi,

I have an existing Microsoft Teams bot built using the TeamsFX SDK (created early 2025). It worked reliably until recently, but now shows the following issue without any code or configuration changes on our side:

System.NullReferenceException: Object reference not set to an instance of an object.

This happens for proactive messaging using adapter.ContinueConversationAsync.
Other functions like turnContext.SendActivityAsync still work.

Code that throws error

await adapter.ContinueConversationAsync(

_botAppId,

conversationReference,

async (turnContext, ct) =>

{

    await turnContext.SendActivityAsync("<message>");

},

req.HttpContext.RequestAborted);

The method itself is marked as deprecated:

'IChannelAdapter.ContinueConversationAsync(string, ConversationReference,

AgentCallbackHandler, CancellationToken)' is obsolete:

'Use ContinueConversationAsync(ClaimsIdentity, ConversationReference,

AgentCallbackHandler, CancellationToken)'

I updated the demo to use the recommended overload:

ContinueConversationAsync(

ClaimsIdentity,

ConversationReference,

AgentCallbackHandler,

CancellationToken)

However, this results in the same NullReferenceException.

I’m aware that the TeamsFX SDK was deprecated in September 2025, but I’m trying to understand whether this behavior is due to:

An explicit service-side change (e.g. auth/token flow retirement), or

A bug / incompatibility introduced during the deprecation window, or

Something tenant/environment specific

Specifically, I’d appreciate clarification on:

Have any underlying services or authentication flows that TeamsFX bots rely on (especially proactive messaging) been disabled or changed?

Is this behavior expected during the TeamsFX deprecation support window (through September 2026)?

For new enterprise-wide bots (e.g. intranet news distribution), is the current Teams SDK / Microsoft 365 Agents SDK expected to be stable long-term?

We are already migrating to the current Teams SDK, but this incident raises concerns around long-term platform stability and support expectations.

Thanks

Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Kudos-Ng 14,265 Reputation points Microsoft External Staff Moderator
    2026-02-09T09:58:53.09+00:00

    Hi JürgenH,

    Thank you for posting your question in the Microsoft Q&A forum.

    Based on what I understand and what I’ve been able to verify, let me clarify a few points and share some practical troubleshooting steps:

    1) About TeamsFx deprecation and your error path

    • You’re right that TeamsFx SDK is in deprecation and Microsoft recommends migrating to the Teams SDK (for Teams‑only apps) or the Microsoft 365 Agents SDK (for multi‑channel/agent scenarios). Deprecation here means no new feature work or official support; however, the SDK still exists, is widely used by the community, and there is a lot of documentation and samples around it.
    • The exception you’re seeing is thrown in adapter.ContinueConversationAsync(...), which belongs to the Bot Framework layer / adapter, not to TeamsFx itself. Moreover, the signature you quoted IChannelAdapter.ContinueConversationAsync(string, ConversationReference, AgentCallbackHandler, CancellationToken)maps to the new Microsoft 365 Agents SDK surface (notice IChannelAdapter and AgentCallbackHandler), rather than TeamsFx. Could you confirm this matches the stack and package versions you’re using?

    This strongly suggests the issue is may not caused by TeamsFx deprecation. The behavior you’re hitting is unexpected for proactive messaging on the adapter layer.

    2) Any recent service‑side changes?

    I couldn't find any public notice that proactive messaging has been disabled or changed service‑side for Teams bots. I’m also not seeing similar widespread reports from other users at this time. This points to something environment‑specific or SDK/configuration related rather than a platform retirement.

    3) Practical troubleshooting for the NullReferenceException

    From past cases and samples, the following have been common causes and fixes:

    1. App ID / configuration value is null at runtime
      If your code path previously called the overload with string appId, please ensure the value is actually present in your environment (e.g., MicrosoftAppId or the correct setting name in your host).
    2. Refresh or minimally reconstruct the ConversationReference
      Even if you persisted an ConversationReference object that looks valid, the stored serviceUrl can become stale over time. A suggestion is to store the minimal set of properties (e.g., serviceUrl, channelId, conversation.id, user.id, bot.id) and reconstruct a new ConversationReference when needed, or re‑capture it from a recent user turn. Also, try testing with a new captured ConversationReference from new activity to see if the issue still persists.

    4) On the stability of the newer SDKs

    For new development, Microsoft’s current guidance is to use Teams SDK (Teams‑only) or Microsoft 365 Agents SDK (multi‑channel). Although these SDKs are newer and some areas still have fewer samples than the old stack, they are the officially supported path and will continue to receive fixes and updates, which is the right direction for long‑term stability.

    I hope the information above helpful. If you have any further questions, please feel free to ask.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".      

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Q&A Assist
    2026-02-09T07:18:35.1833333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It appears that you are encountering a NullReferenceException when using the ContinueConversationAsync method in your TeamsFX bot, which has been marked as deprecated. Here are some insights regarding your concerns:

    1. Deprecation and Changes: The deprecation of the TeamsFX SDK and the associated methods may lead to unexpected behavior as the platform evolves. While the SDK was deprecated in September 2025, it is possible that underlying services or authentication flows have changed, which could affect proactive messaging.
    2. Service-side Changes: It is essential to check if there have been any announcements or documentation updates from Microsoft regarding changes to the authentication flows or services that TeamsFX bots rely on, especially for proactive messaging. This could include changes in token handling or service endpoints.
    3. Expected Behavior During Deprecation: During the deprecation support window, it is not uncommon for deprecated features to become unstable or to behave unexpectedly. Therefore, encountering issues like the NullReferenceException may be expected as the platform transitions.
    4. Long-term Stability of Current SDKs: The current Teams SDK and Microsoft 365 Agents SDK are designed to be stable and supported long-term. If you are migrating to these SDKs, they should provide a more reliable foundation for your bot development moving forward.

    Given your situation, I recommend continuing with the migration to the current SDK and monitoring any updates from Microsoft regarding the TeamsFX SDK deprecation and any related service changes.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.