Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ArrayTypeMismatchException Error when trying to initialize DirectLineClient #279

Open
Mounicadvp opened this issue Dec 27, 2024 · 0 comments

Comments

@Mounicadvp
Copy link

Background:
Trying to connect to copilot studio agent using Direct Line.

  1. Fetch the DirectLineToken using the web channel security key. Result is success i.e., able to fetch the token.
  2. URI used to generate the token in step 1 is https://directline.botframework.com/v3/directline/tokens/generate
  3. Use the token from step 1, initialize the var directLineClient = new DirectLineClient(token),
  4. Error is thrown as below: System.ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array.
    at System.Collections.Generic.List`1.Add(T item)
    at Microsoft.Bot.Connector.DirectLine.DirectLineClient.Initialize()

Expected behavior
Should be able to initialize the Client.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Sample code taken from https://github.com/microsoft/CopilotStudioSamples/blob/master/BotConnectorApp/BotConnectorApp/BotConnectorApp/Program.cs
Package version of Microsoft.Bot.Connector.DirectLine used is 3.0.2 (latest stable version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant