Skip to content

Native AOT publish hangs at IlcCompile when FreeSql.Provider.QuestDb brings in old Npgsql (5.0.18) #2021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mmahdium opened this issue May 3, 2025 · 0 comments

Comments

@mmahdium
Copy link

mmahdium commented May 3, 2025

问题描述及重现代码:

Using FreeSql.Provider.QuestDb in a .NET 9.0 ASP.NET Core project with Native AOT publish and <TrimmerRootAssembly Include="Npgsql" /> causes the publish to hang indefinitely at the IlcCompile step, consuming excessive memory.

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <PublishAot>true</PublishAot>
    <InvariantGlobalization>true</InvariantGlobalization>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="FreeSql.Repository" Version="3.5.204" />
    <PackageReference Include="FreeSql.Provider.QuestDb" Version="3.5.204" />
    <!-- Npgsql is rooted to avoid trimming, but the old version causes hangs -->
    <TrimmerRootAssembly Include="Npgsql" />
  </ItemGroup>
</Project>
  1. dotnet add package FreeSql.Repository --version 3.5.204
  2. dotnet add package FreeSql.Provider.QuestDb --version 3.5.204
  3. Enable Native AOT and root Npgsql in the .csproj as shown above.
  4. Run dotnet publish -c Release -v diag and observe hang at IlcCompile.

数据库版本

Not applicable (QuestDB provider, no live database connection needed for repro).

安装的Nuget包

  • FreeSql.Repository v3.5.204
  • FreeSql.Provider.QuestDb v3.5.204
  • (Transient) Npgsql v5.0.18 pulled in by QuestDb provider, causing the issue

.net framework/. net core? 及具体版本

  • .NET SDK 9.0.203 (net9.0)
  • Target framework: .NET 9.0 (ASP.NET Core Web API)
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

No branches or pull requests

1 participant