[2.x] Warnings when `PublishAot` is enabled.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start in Silk.NET.Core.Loader.DefaultPathResolver, where the warnings identify Assembly.Location, Assembly.CodeBase, and DependencyContext.Default usage. Reproduce with a small .NET 10 project using PublishAot=true and Vk.GetApi(), then trace the resolver paths that trigger the warnings. Done means AOT publishing no longer emits the reported warnings while native library loading continues to work.
索引モデルが issue の本文から書いたものです。
説明
Summary
Silk.NET library loader generates warnings when AoT is enabled. Everything works at runtime with AOT, but warnings are reported and cannot be easily supressed.
Steps to reproduce
- Platform: Any (tested on Windows 11)
- Dotnet: v10.0.x
- Create a new dotnet project with
<PublishAot>true</PublishAot> - Add one single line:
using var vk = Vk.GetApi();. It fails with anyFoo.GetApi()call, not only with Vulkan. - You get the following warnings:
jhmci@CIBERMAN-PC MINGW64 /c/repos/open-source/silk-aot-repro
$ dotnet publish -c Release -r win-x64 -p:PublishAot=true
Restore complete (0.5s)
SilkAotRepro net10.0 win-x64 succeeded with 6 warning(s) (9.0s) → bin\Release\net10.0\win-x64\publish\
ILC : warning IL3000: Silk.NET.Core.Loader.DefaultPathResolver.<>c.<.cctor>b__24_3(String): 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.
ILC : warning IL3002: Silk.NET.Core.Loader.DefaultPathResolver.<>c.<.cctor>b__24_3(String): Using member 'System.Reflection.Assembly.CodeBase.get' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app. This member throws an exception for assemblies embedded in a single-file app.
ILC : warning IL3002: Silk.NET.Core.Loader.DefaultPathResolver.TryLocateNativeAssetFromDeps(String,String&,String&): Using member 'Microsoft.Extensions.DependencyModel.DependencyContext.Default.get' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app. DependencyContext for an assembly from a application published as single-file is not supported. The method will return null. Make sure the calling code can handle this case.
ILC : warning IL3000: Silk.NET.Core.Loader.DefaultPathResolver.TryLocateNativeAssetFromDeps(String,String&,String&): 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.
ILC : warning IL3002: Silk.NET.Core.Loader.DefaultPathResolver.TryLocateNativeAssetInRuntimesFolder(String,String,String&): Using member 'Microsoft.Extensions.DependencyModel.DependencyContext.Default.get' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app. DependencyContext for an assembly from a application published as single-file is not supported. The method will return null. Make sure the calling code can handle this case.
ILC : warning IL3002: Microsoft.Extensions.DependencyModel.DependencyContext..cctor(): Using member 'Microsoft.Extensions.DependencyModel.DependencyContext.LoadDefault()' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app. DependencyContext for an assembly from a application published as single-file is not supported. The method will return null. Make sure the calling code can handle this case.
Build succeeded with 6 warning(s) in 10.4s
Comments
Add any other context about the problem here.
If you know how to fix this issue, please submit a pull request instead!
- 主要言語
- C#
- スター
- 5.3k
- フォーク
- 484
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/Silk.NET のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
-
難易度 3/5 半日 初心者へのやさしさ 40/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
dotnet/Silk.NET の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug mac アプリ: コード アプリ: チャット 優先: 中 要トリアージ
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
yksr-melt/Meltype#1346 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Collect corrected translations in the app, with no GitHub account and the least possible frictionオープンlocalization medium ui
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
hexide-io/HexIDE#2819 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100