SciSharp / BotSharp

The AI Agent Framework in .NET
https://botsharp.readthedocs.io
Apache License 2.0
1.99k stars 413 forks source link

compilation errors #409

Closed PontiacGTX closed 1 month ago

PontiacGTX commented 1 month ago

when adding the BotSharp Core services it throws an exception: System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types. Method 'DeleteAgent' in type 'BotSharp.Core.Repository.BotSharpDbContext' from assembly 'BotSharp.Core, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'DeleteAgent' in type 'BotSharp.Core.Repository.FileRepository' from assembly 'BotSharp.Core, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'UpdateBreakpoint' in type 'BotSharp.Core.Conversations.Services.ConversationService' from assembly 'BotSharp.Core, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'Load' in type 'BotSharp.Core.Conversations.Services.ConversationStateService' from assembly 'BotSharp.Core, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'RefreshAgents' in type 'BotSharp.Core.Agents.Services.AgentService' from assembly 'BotSharp.Core, Version=1.2.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.' Unhandled exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Method 'DeleteAgent' in type 'BotSharp.Core.Repository.BotSharpDbContext' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'DeleteAgent' in type 'BotSharp.Core.Repository.FileRepository' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'Load' in type 'BotSharp.Core.Conversations.Services.ConversationStateService' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'RefreshAgents' in type 'BotSharp.Core.Agents.Services.AgentService' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at BotSharp.Core.Plugins.PluginLoader.<>c__DisplayClass7_0.b__0(String assemblyName) at System.Collections.Generic.List1.ForEach(Action1 action) at BotSharp.Core.Plugins.PluginLoader.Load(Action1 loaded, String plugin) at BotSharp.Core.BotSharpCoreExtensions.RegisterPlugins(IServiceCollection services, IConfiguration config) at BotSharp.Core.BotSharpCoreExtensions.AddBotSharpCore(IServiceCollection services, IConfiguration config, Action1 configOptions) at Program.

$(String[] args) in C:\Users\PontiacGTX\source\repos\BotSharp\src\WebStarter\Program.cs:line 32

hchen2020 commented 1 month ago

Which version are you using? Why there are v1.2.1 and v1.3.1 both in the error log?

PontiacGTX commented 1 month ago

Which version are you using? Why there are v1.2.1 and v1.3.1 both in the error log?

I was using 1.3 stable through the repository but I dont find the branch 1.3.1

edit: I added the nugget BotSharpCore v1.3.1) to the WebStarter project System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types. Method 'DeleteAgent' in type 'BotSharp.Core.Repository.BotSharpDbContext' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'DeleteAgent' in type 'BotSharp.Core.Repository.FileRepository' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'Load' in type 'BotSharp.Core.Conversations.Services.ConversationStateService' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Method 'RefreshAgents' in type 'BotSharp.Core.Agents.Services.AgentService' from assembly 'BotSharp.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.'

if you see the code there are some method arent defined and some like DeleteAgent arent defined (somehow they are called in AgentService) https://github.com/SciSharp/BotSharp/blob/v1.3-Stable/src/Infrastructure/BotSharp.Core/Repository/BotSharpDbContext.cs

Oceania2018 commented 1 month ago

This is the branch https://github.com/SciSharp/BotSharp/tree/v1.3-Stable

PontiacGTX commented 1 month ago

This is the branch https://github.com/SciSharp/BotSharp/tree/v1.3-Stable

I was using that branch and just throws and exception when you add a reference from VS 2022 solution for the pizzabot. (also happens using the example dotnet cli command) even you can see the CI notice that it wasnt working when it was merged also the 1.3.1 package has the same error

Oceania2018 commented 1 month ago

What about latest release https://github.com/SciSharp/BotSharp/tree/v1.3.2-refresh-agent? Can you provide the screenshot shows the error and the how you add reference?

PontiacGTX commented 1 month ago

@Oceania2018 Now it is fully functional, Thank you