Skip to content

Fix two build errors in CoreGenerativeAITechniques.sln#500

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-github-actions-workflow
Closed

Fix two build errors in CoreGenerativeAITechniques.sln#500
Copilot wants to merge 2 commits intomainfrom
copilot/fix-github-actions-workflow

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Two compiler errors introduced by upstream SDK changes were breaking the CI build for samples/CoreSamples/CoreGenerativeAITechniques.sln.

AgentLabs-02-Functions — CS0121 ambiguous overload

Azure.AI.Agents.Persistent 1.2.0-beta.8 added a new SubmitToolOutputsToRunAsync overload accepting IEnumerable<ToolApproval>, making the two-arg call ambiguous. Fixed by passing CancellationToken.None explicitly:

// Before
runResponse = await persistentClient.Runs.SubmitToolOutputsToRunAsync(runResponse, toolOutputs);

// After
runResponse = await persistentClient.Runs.SubmitToolOutputsToRunAsync(runResponse, toolOutputs, CancellationToken.None);

MCP-02-HuggingFace-Ollama — CS1061 missing AsBuilder

OllamaApiClient (OllamaSharp 5.x) implements IChatClient directly, but the code was bridging through Semantic Kernel (.AsChatCompletionService().AsChatClient()) which left the compiler resolving the concrete type rather than the interface — so the AsBuilder() extension from Microsoft.Extensions.AI wasn't found. Additionally, the project only referenced Microsoft.Extensions.AI.Abstractions, which doesn't include AsBuilder/UseFunctionInvocation.

  • Replaced Microsoft.Extensions.AI.Abstractions with Microsoft.Extensions.AI 10.3.0 (consistent with other samples)
  • Removed the unnecessary SK bridge; assign directly to IChatClient
// Before
var client = new OllamaApiClient(uri, deploymentName)
    .AsChatCompletionService()
    .AsChatClient()
    .AsBuilder()
    .UseFunctionInvocation()
    .Build();

// After
IChatClient ollamaClient = new OllamaApiClient(uri, deploymentName);
var client = ollamaClient
    .AsBuilder()
    .UseFunctionInvocation()
    .Build();
Original prompt

Fix the failing GitHub Actions workflow Build .NET Projects (samples/CoreSamples/CoreGenerativeAITechniques.sln, Core Samples)
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 65193236999
Job URL: https://github.com/microsoft/Generative-AI-for-beginners-dotnet/actions/runs/22502597796/job/65193236999


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: PabloNunes <21008820+PabloNunes@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow for .NET projects Fix two build errors in CoreGenerativeAITechniques.sln Feb 27, 2026
@PabloNunes PabloNunes marked this pull request as ready for review February 27, 2026 20:48
@PabloNunes PabloNunes closed this Feb 27, 2026
@PabloNunes PabloNunes deleted the copilot/fix-github-actions-workflow branch February 27, 2026 20:50
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

Successfully merging this pull request may close these issues.

2 participants