Skip to content

.NET Code sample for using CLI server mode is incorrect #220

@zhiyuanliang-ms

Description

@zhiyuanliang-ms

I got the following error when using CLI server mode

Unhandled exception. System.ArgumentException: CliUrl is mutually exclusive with UseStdio and CliPath at GitHub.Copilot.SDK.CopilotClient..ctor(CopilotClientOptions options) at Program.<Main>$(String[] args) in C:\Users\zhiyuanliang\Desktop\AI\CopilotDemo\Program.cs:line 44 at Program.<Main>(String[] args)

The correct code should look like:

await using var client = new CopilotClient(new CopilotClientOptions
{
    CliUrl = $"localhost:{port}",
    UseStdio = false
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions