microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
878 stars 484 forks source link

Updating Package Microsoft.Bot.Builder.Integration.Aspt.Core from 4.21.1 to 4.22.4 no longer finds ITeamsCommandHandler #6797

Closed johnyjp closed 5 months ago

johnyjp commented 5 months ago

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

What package version of the SDK are you using. 4.22.4

Describe the bug

Give a clear and concise description of what the bug is. Updating Package Microsoft.Bot.Builder.Integration.Aspt.Core from 4.21.1 to 4.22.4 no longer finds ITeamsCommandHandler. Suggestion is to add a package reference to Microsoft.Bot.Builder but that does not resolve the issue.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Open example command bot project from File -> New Project MSTeams App -> CommandBot Build - Compiles fine. Nuget Packages -> update to 4.22 -> Build fails with

error CS0012: The type 'ITurnContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Bot.Builder, Version=4.21.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Expected behavior

Give a clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

.net 8.0 project, No additional code other than that provided by the new project wizard.

tracyboehrer commented 5 months ago

@johnyjp ITeamsCommandHandler is not a Bot Framework SDK interface. But the real problem is the CS0012 error. Are you using Teams AI SDK and it's using 4.21.1? Or something else using 4.21.1?

mpec commented 5 months ago

We have a similar issue but the error in our case is: The type 'ConversationReference' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Bot.Schema, Version=4.21.1.0

We are running 4.22.2 and trying to upgrade to 4.22.4.

No reference to 4.21.1.0 is present anywhere

tracyboehrer commented 5 months ago

@mpec Are you also a Teams app? That is, have dependencies on any Teams package?

mpec commented 5 months ago

@tracyboehrer this is our dependency tree: image So it's an Azure Function that uses AspNetCore integration.

tracyboehrer commented 5 months ago
image
mpec commented 5 months ago

I see, so it's an issue with TeamsFx. How come a minor version update breaks this though?

tracyboehrer commented 5 months ago

@mpec All in the mysteries of DotNet package resolution.

tracyboehrer commented 5 months ago

@mpec To be fair, not really a TeamsFx issue. This dependency conflict is not uncommon in general. One correction would be to have TeamsFx update their version. But that is a moving target. With some it could be problematic. Though probably not in this case.

Some perhaps helpful links:

https://learn.microsoft.com/en-us/nuget/concepts/dependency-resolution https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/dependencies https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions

mpec commented 5 months ago

Thanks for all your help @tracyboehrer, I'll probably delay the upgrade for now. :)

tracyboehrer commented 5 months ago

@mpec They will be forced to update at some point. A good number of changes are dependency updates to address security alerts. Which they will get tagged for until they do.

johnyjp commented 5 months ago

@johnyjp ITeamsCommandHandler is not a Bot Framework SDK interface. But the real problem is the CS0012 error. Are you using Teams AI SDK and it's using 4.21.1? Or something else using 4.21.1?

Yes, using Teams SDK, cant see a reference to 4.21.1 anywhere.

tracyboehrer commented 5 months ago

Closing as this is a general issue with dependency resolution. No corrective action possible by DotNet BF SDK.