Sql4Cds icon indicating copy to clipboard operation
Sql4Cds copied to clipboard

Method not Found error when Attempting to use Co Pilot

Open daryllabar opened this issue 1 year ago • 4 comments

Method not found: 'System.Collections.Generic.IAsyncEnumerator`1<!0> System.ClientModel.AsyncResultCollection`1.GetAsyncEnumerator(System.Threading.CancellationToken)'.

image I'm getting this error, using a Azure Open-AI deployment. I received no error in the 9.2 version of the tool, and this error in the 9.3 version. It is actually hitting my Azure Deployment.

I've never set this up before, so it could be something silly. Thoughts?

daryllabar avatar Aug 30 '24 19:08 daryllabar

Looks like this is somehow specific to Azure OpenAI, I can't reproduce it on OpenAI itself. I'll keep digging...

MarkMpn avatar Aug 31 '24 14:08 MarkMpn

I now can't reproduce this with Azure OpenAI either after restarting XrmToolBox. If you can reproduce it, are you able to do some diagnostics for me please?

  1. Check that none of the files in the Plugins\MarkMpn.Sql4Cds folder are also in the main Plugins folder
  2. Once the error has occurred, attach the Visual Studio debugger and open the Debug > Windows > Modules window. Select all the entries, copy & paste them into Excel and upload that here

MarkMpn avatar Aug 31 '24 15:08 MarkMpn

  1. Confirmed, no dlls that are in the sub folder are in the main plugin folder, or visa versa.
  2. Attempting to process this, and got this error:

image

Which looks like I have to wait a day to try again? I just asked how many Contacts do I have?

I'm wondering if the method not found errors is due to another plugin loading and loading a different version of a dependent assembly... I thought the XTB handled loading multiple versions of dependent assemblies, but maybe not?

daryllabar avatar Sep 16 '24 18:09 daryllabar

Yes, my instinct is that the method not found error is due to some conflict with another plugin. Because all the plugins are loaded into the same AppDomain and they can each define their own AssemblyResolve event handlers it gets difficult to be sure exactly what is going to be loaded. I also see different assemblies being loaded the first time after installing a new version of the tool vs subsequent starts, so it seems like the install process itself can affect things. Ideally XrmToolBox would allow us to isolate tools more, but I don't think that's going to be possible at this point. I may also see if I can ILMerge the plugin again so it doesn't require any external assemblies, but the last time I tried that it didn't work with the latest version of the SQL parser assembly for some reason.

The rate limit error is coming from your Azure OpenAI instance - you probably need to check the quota you have available.

MarkMpn avatar Sep 17 '24 07:09 MarkMpn