Skip to content

Conversation

@rido-min
Copy link
Member

This pull request introduces several improvements and new features to the Microsoft.Bot.Core SDK, focusing on enhanced JSON serialization for AOT compatibility, middleware extensibility, and developer experience. The most significant changes are grouped below:

Serialization and AOT Compatibility

  • Added a source-generated JSON serialization context (CoreActivityJsonContext) for core activity types, enabling reflection-free and AOT-compatible serialization and deserialization throughout the SDK. Updated all relevant serialization methods in CoreActivity and related schema classes to use this context for base types, while maintaining reflection-based serialization for extended/custom types. [1] [2] [3] [4] [5] [6] [7]
  • Changed the Properties member in CoreActivity, ChannelData, Conversation, and ConversationAccount from init to set to support deserialization scenarios, with appropriate suppression of CA2227 warnings. [1] [2] [3] [4]
  • Added a new test project (aot-checks) and sample code to verify AOT serialization/deserialization of Teams activities. [1] [2] [3]

Middleware and Extensibility

  • Introduced a middleware scenario sample (middleware.cs) demonstrating how to use custom turn middleware with the bot application, improving extensibility and developer onboarding.
  • Updated dependency injection logic in AddBotApplicationClients to gracefully handle missing configuration sections, logging a warning and providing fallback behavior.

Developer Experience and Documentation

  • Added a new README for Microsoft.Bot.Core with installation instructions and usage examples, including how to run scenarios and use the playground.
  • Updated the devcontainer configuration to specify .NET 10.0 and add Docker-in-Docker support for development environments.

Sample and Logging Improvements

  • Enhanced logging in BotApplication to include the SDK version and improved the sample bot reply to display SDK version, activity details, and conversation info. [1] [2] [3]
  • Updated sample configuration and improved URL handling in ConversationClient for robustness. [1] [2]

rido-min and others added 7 commits December 10, 2025 05:59
… to be settable and add source generator context
Introduce ReflectionJsonOptions for serialization/deserialization of custom CoreActivity-derived types not registered in the source-generated context. Update ToJson<T>, FromJsonString<T>, and FromJsonStreamAsync<T> to use reflection-based options for broader type support.
@rido-min rido-min closed this Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants