microsoft / microsoft/CopilotStudioSamples
System.ArrayTypeMismatchException Error when trying to initialize DirectLineClient
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 797
- Forks
- 491
- PR merge metrics
- No merged PRs in 30d
Description
Background:
Trying to connect to copilot studio agent using Direct Line.
- Fetch the DirectLineToken using the web channel security key. Result is success i.e., able to fetch the token.
- URI used to generate the token in step 1 is https://directline.botframework.com/v3/directline/tokens/generate
- Use the token from step 1, initialize the
var directLineClient = new DirectLineClient(token), - 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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced BotConnectorApp/Program.cs sample and the Microsoft.Bot.Connector.DirectLine 3.0.2 package, then reproduce the DirectLineClient(token) initialization using the token-generation URI described in the issue. Trace the reported System.ArrayTypeMismatchException in DirectLineClient.Initialize(); done means the client initializes without that exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100