net10.0net8.0
Library for creating agents using Microsoft Agent SDK
Published
Sep 11, 2026
1mo ago
Total Downloads
824.0K
824,044
Install
dotnet add package Microsoft.Agents.Hosting.AspNetCore --version 1.9.35-beta
| Product | Versions |
|---|---|
| .NET |
README
Microsoft.Agents.Hosting.AspNetCore
About
ASP.NET Core hosting for agents built with the Microsoft 365 Agents SDK. This package connects the SDK's agent and adapter abstractions to ASP.NET Core dependency injection, middleware, and endpoint routing so applications can receive Activity Protocol requests from Azure Bot Service and other channels.
Main APIs
- Host setup:
AddAgentDefaults(),AddAgent<T>(), andAddAgentAuthorization()register the common ASP.NET Core services, an agent with itsCloudAdapter, and an application-selected authentication scheme. - Request pipeline:
UseAgents()adds authentication, authorization, and header propagation middleware. - Endpoint mapping:
MapDefaultAgentEndpoints()provides conventional root and Activity Protocol endpoints.MapAgentApplicationEndpoints(),MapAgentEndpoints(), andMapAgentProactiveEndpoints<TAgent>()support custom and proactive routing. - Adapters:
CloudAdapterandIAgentHttpAdaptertranslate ASP.NET Core HTTP requests and responses to the SDK activity-processing pipeline, including invoke, expect-replies, and streaming responses. - Optional integrations: Host extensions register agent middleware, HTTP or Microsoft 365 attachment downloaders, background activity processing, and request-header propagation.
Authentication enforcement integrates with ASP.NET Core, but this package does not provide a concrete authentication scheme.
Changes from Previous Version
No structural changes between v1.9.28-beta and v1.9.35-beta.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.