Skip to content

error in dotnet quick start #34

Description

@ruairica

dotnet version
10.0.101

Sdk version:
<PackageReference Include="GitHub.Copilot.SDK" Version="0.1.12" />

Steps to reproduce:

  • Create a console app with dotnet new console -n test
  • cd test
  • dotnet add package GitHub.Copilot.SDK
  • Paste the quick start from the dotnet readme into Program.cs
using GitHub.Copilot.SDK;

// Create and start client
await using var client = new CopilotClient();
await client.StartAsync();

// Create a session
await using var session = await client.CreateSessionAsync(new SessionConfig
{
    Model = "gpt-5"
});

// Wait for response using session.idle event
var done = new TaskCompletionSource();

session.On(evt =>
{
    if (evt is AssistantMessageEvent msg)
    {
        Console.WriteLine(msg.Data.Content);
    }
    else if (evt is SessionIdleEvent)
    {
        done.SetResult();
    }
});

// Send a message and wait for completion
await session.SendAsync(new MessageOptions { Prompt = "What is 2+2?" });
await done.Task;

dotnet run

Result:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'StreamJsonRpc, Version=2.22.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'StreamJsonRpc, Version=2.22.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at GitHub.Copilot.SDK.CopilotClient.CleanupConnectionAsync(List`1 errors)
   at GitHub.Copilot.SDK.CopilotClient.CleanupConnectionAsync(List`1 errors)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at GitHub.Copilot.SDK.CopilotClient.CleanupConnectionAsync(List`1 errors)
   at GitHub.Copilot.SDK.CopilotClient.ForceStopAsync()        
   at GitHub.Copilot.SDK.CopilotClient.DisposeAsync()
   at Program.<Main>$(String[] args) in C:\Source\personal\ralph-csharp\quickstart\sample\test\Program.cs:line 30
   at Program.<Main>(String[] args)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions