Skip to content

New Feature: Make Microsoft.SemanticKernel.Plugins.OpenApi compatible with .Net10 #13373

@hesehus-bizzkit-mibu

Description

@hesehus-bizzkit-mibu

name: Feature request
about: Suggest an idea for this project


As is

The following code

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
    <PackageReference Include="Microsoft.SemanticKernel" Version="1.67.1" />
    <PackageReference Include="Microsoft.SemanticKernel.Plugins.OpenApi" Version="1.67.1" />
  </ItemGroup>

</Project>
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Plugins.OpenApi;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddOpenApi();
var kernelBuilder = Kernel.CreateBuilder();
var plugin = await OpenApiKernelPluginFactory.CreateFromOpenApiAsync(
    pluginName: "Api",
    uri: new Uri("https://petstore.swagger.io/v2/swagger.json")
);
kernelBuilder.Plugins.Add(plugin);

var app = builder.Build();

app.MapOpenApi();
app.UseHttpsRedirection();
app.MapGet("/", () =>
{
    return "Hello World";
})
.WithName("SayHello");

app.Run();

will throw exception of type TypeLoadException.

Wanted behavior

The dependency on Microsoft.OpenApi in SemanticKernel is updated to 2.0.0 to be compatible with Microsoft.AspNetCore.OpenApi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions