You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Composer机器人项目中安装BotBuilder-Samples的handoff-library?相关安装指引缺失及文档不匹配问题咨询

Adding the Experimental Handoff Library to Your Bot Framework Composer Project

You’re definitely not missing something obvious here—this experimental handoff library is light on Composer-specific setup docs, which is a total pain. Let’s break down the actual steps to get it integrated, since the standard custom action guide doesn’t cover pre-built library cases like this:

1. Prep the Handoff Library Files

Since you already cloned the repo, head to the experimental/handoff-library folder.

  • Open the Microsoft.Bot.Builder.Handoff C# project in Visual Studio (or use the .NET CLI) and build it:
    dotnet build
    
  • Grab the compiled Microsoft.Bot.Builder.Handoff.dll and any related dependency DLLs from the bin/Debug (or Release) directory—don’t skip the dependencies, they’re crucial.

2. Add the Library to Your Composer Project

  • Navigate to your Composer bot’s root folder and create a new directory (name it something like CustomLibraries to keep things organized).
  • Copy all the DLLs from step 1 into this new folder.
  • Now, edit your bot’s .csproj file (it lives in the Generated folder for C# bots):
    • Add a reference to the handoff DLL by inserting this snippet inside the <Project> tag:
      <ItemGroup>
        <Reference Include="Microsoft.Bot.Builder.Handoff">
          <HintPath>..\CustomLibraries\Microsoft.Bot.Builder.Handoff.dll</HintPath>
        </Reference>
        <!-- Add references for any other dependency DLLs here too -->
      </ItemGroup>
      
  • Save the file and restart Composer so it picks up the new library reference.

3. Register the Handoff Services

  • Open your bot’s Program.cs file (also in the Generated folder). Look for the section where bot services are registered (you’ll see lines like builder.Services.AddBotRuntime()).
  • Add the handoff service registration:
    builder.Services.AddHandoff();
    
  • Don’t forget to add the using statement at the top of the file:
    using Microsoft.Bot.Builder.Handoff;
    

4. Use Handoff Actions in Your Dialogs

Since this is an experimental library, Composer’s UI might not auto-populate the handoff actions. You’ll need to either:

  • Manually add actions via Composer’s code editor, referencing the fully qualified class names from the library (check the repo’s source code for exact names like TriggerHandoffAction).
  • Use the "Custom Action" option in Composer’s dialog designer and input the full class path for the handoff action you want to use.

Why the Official Custom Action Guide Doesn’t Fit

The standard guide walks you through building a custom action from scratch, but this handoff library is a pre-built component. You don’t need to create the action project itself—just reference the compiled DLL and register its services. That’s where the guide diverges, which is why it didn’t match your use case.

If you hit snags, double-check that:

  • All dependency DLLs from the library’s build are copied over.
  • Your bot’s .NET version matches the library’s (it should target .NET 6 or higher, same as most modern Composer bots).

内容的提问来源于stack exchange,提问作者Karric

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 12:37:36