OfficeDev/teams-toolkit

CS0012 The type 'InvokeResponse' is defined in an assembly that is not referenced.

Closed this issue · 2 comments

Describe the bug

After upgrading to <PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.22.3" /> from <PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.22.2" /> I get the following error message while compiling
CS0012 The type 'InvokeResponse' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Bot.Connector, Version=4.21.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

This happens even if I explicitly reference Microsoft.Bot.Connector

  <ItemGroup>
    <PackageReference Include="AdaptiveCards" Version="3.1.0" />
    <PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.22.3" />
    <PackageReference Include="Microsoft.Bot.Connector" Version="4.22.3" />
    <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
    <PackageReference Include="Microsoft.Graph" Version="5.54.0" />
    <PackageReference Include="Microsoft.TeamsFx" Version="2.4.1">
      <!-- Exclude TeamsFx wwwroot static files which are for frontend only. -->
      <ExcludeAssets>contentFiles</ExcludeAssets>
    </PackageReference>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
  </ItemGroup>

To Reproduce

Happens in all places using InvokeResponseFactory.ErrorResponse(InvokeResponseErrorCode.BadRequest, "Invalid card data. Please contact your administrator.");
Decompiled sources navigate to

// Decompiled with JetBrains decompiler
// Type: Microsoft.TeamsFx.Conversation.InvokeResponseFactory
// Assembly: Microsoft.TeamsFx, Version=2.4.1.0, Culture=neutral, PublicKeyToken=null
// MVID: D54ECFF6-FDCA-4E63-A874-079F89A1DFCF
// Assembly location: C:\Users\x\.nuget\packages\microsoft.teamsfx\2.4.1\lib\net6.0\Microsoft.TeamsFx.dll
// XML documentation location: C:\Users\x\.nuget\packages\microsoft.teamsfx\2.4.1\lib\net6.0\Microsoft.TeamsFx.xml

Maybe TeamsFx needs to be updated, too?

Expected behavior

No error

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

Maybe it is the same as #11677, we will Upgrade Microsoft.Bot.Builder to latest version.