dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.41k stars 4.76k forks source link

Request to Update Target Framework for Microsoft.Extensions.AI.Abstractions #110039

Closed cloudsere closed 3 hours ago

cloudsere commented 23 hours ago

Description

Hi Team,

We noticed that the latest release of Microsoft.Extensions.AI.Abstractions targets .NET Framework 4.6.2. However, .NET Framework 4.6.2 will reach end of support on January 12, 2027. https://learn.microsoft.com/en-us/lifecycle/products/microsoft-net-framework

Our project uses .NET Framework 4.7.2, which has long-term support, but we are currently blocked from using this package due to the lack of target platform support for .NET Framework 4.7.2.

Could you please update the target framework to .NET Framework 4.7.2 in future releases to ensure compatibility with our project and other similar scenarios?

Thank you for your consideration!

Reproduction Steps

Add Microsoft.Extensions.AI.Abstractions to a .NET Framework 4.7.2 project

Expected behavior

Microsoft.Extensions.AI.Abstractions targets .NET Framework 4.7.2

Actual behavior

Image

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

huoyaoyuan commented 23 hours ago

Our project uses .NET Framework 4.7.2, which has long-term support, but we are currently blocked from using this package due to the lack of target platform support for .NET Framework 4.7.2.

Could you please update the target framework to .NET Framework 4.7.2 in future releases to ensure compatibility with our project and other similar scenarios?

It isn't needed. Any package supporting .NET Framework 4.6.2 is supporting .NET Framework 4.7.2.

The warning message means you aren't targeting .NET Framework 4.7.2 in your project, but other .NET Standard compatible frameworks. I can't reproduce it on a fresh .NET Framework 4.7.2 project.

huoyaoyuan commented 23 hours ago

The package lives in https://github.com/dotnet/extensions , though it can also be helpful to discuss in this repo. You can navigate with "Source repository" link on nuget.org.

cloudsere commented 21 hours ago

Hi @huoyaoyuan thanks for sharing, but this is our error: Microsoft.Extensions.AI.Abstractions 9.0.0-preview.9.24525.1 doesn't support net472 and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. wondering do you know the reason?

huoyaoyuan commented 21 hours ago

It's better to collect msbuild binlog to see what happens. Note that it would contain information about your project and source code. Are you using the old .NET Framework project, or new SDK-style project?

cloudsere commented 21 hours ago

Hi @huoyaoyuan, we are using the old .NET Framework project:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <IsWebBootstrapper>false</IsWebBootstrapper>
    <EnableNETAnalyzers>true</EnableNETAnalyzers>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
huoyaoyuan commented 20 hours ago

It looks strange. Looking through the package content of Microsoft.Extensions.AI.Abstractions, it doesn't contain msbuild targets for the target framework validation logic. Can you confirm which .targets file the warning comes from?

cloudsere commented 18 hours ago

Hi @huoyaoyuan, the .targets file is

139>...\.nuget\packages\microsoft.extensions.ai.abstractions\9.0.0-preview.9.24525.1\buildTransitive\net462\Microsoft.Extensions.AI.Abstractions.targets(5,5): warning : Microsoft.Extensions.AI.Abstractions 9.0.0-preview.9.24525.1 doesn't support net472 and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. You may also set <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk.

cloudsere commented 18 hours ago

The package lives in https://github.com/dotnet/extensions , though it can also be helpful to discuss in this repo. You can navigate with "Source repository" link on nuget.org.

Yes, I actually came from the 'Source repository' link. However, when I created the issue, I selected 'Issue with .NET runtime or core .NET libraries,' which redirected me here. I can move the issue to the https://github.com/dotnet/extensions repo though:) Image

huoyaoyuan commented 18 hours ago

OK I looked closely into the version. The warning was present in the previous version 9.0.0-preview9.24525.1. The warning unconditionally applied to any .NET Framework version, including .NET Framework 4.6.2. It's now removed from the latest version 9.0.0-preview.9.24556.5.

However, when I created the issue, I selected 'Issue with .NET runtime or core .NET libraries,' which redirected me here.

"Core" means libraries under System namespace and a portion of Microsoft.Extensions that has been ported here.

cloudsere commented 3 hours ago

@huoyaoyuan Thanks for sharing!

However, we are using the latest SemanticKernel@1.0.30.0, which is still using the old version 9.0.0-preview.9.24525.1: Image

That said, I noticed that SemanticKernel was updated just 14 hours ago: Link to commit. https://github.com/microsoft/semantic-kernel/commit/96b3595af4dc35e0bc866409677e426cf5a56912#diff-21abc2ac38e0ade95299a2450724507fe1d080c383a3024337f9177278c64186L66

So I think once the new version got release, our problem will be resolved, thanks!