.NET 7 (RC1) trimming results in error
還沒有人認領這個 Issue。
評估
研究方向
使用 .NET 7 和提供的 dotnet publish 命令重現該故障,然後將其與停用 trimming 以及 TrimMode=partial 的情況進行比較。閱讀連結的 trimming 指南,並檢查該程式庫如何處理會產生錯誤的選項。當啟用 trimming 的發佈能夠執行且不再出現設定選項時回報的錯誤,同時保留正常的命令列行為時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
I've just upgraded my project to .NET 7 and seen that it results in an error (when running):
Error setting value to option 'u, url': Check if Option or Value attribute values are set properly for the given type.
Error setting value to option 't, threads': Check if Option or Value attribute values are set properly for the given type.
etc..
https://github.com/KoalaBear84/OpenDirectoryDownloader/
If I build it with the following it fails (when running):
dotnet publish OpenDirectoryDownloader --configuration Release --framework net7.0 --runtime win-x64 -p:PublishTrimmed=true
If I remove the -p:PublishTrimmed=true it works. This tells me it could be because of the trimming that will trim something that is important for this library.
Also tried with -p:TrimMode=Link and -p:TrimMode=CopyUsed, but it doesn't make a difference, but found out that -p:TrimMode=partial (Only worked with a lowercase p here) does, as it restores the behaviour of .NET 6.
Maybe this can be resolved at the library side, but I don't have experience with that.
https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming
It would be nice if it can be solved, as more users will try/upgrade to .NET 7. Until then this issue will be helpful for everyone looking for a quick workaround.
- 主要語言
- C#
- 星號
- 4.8k
- 分支
- 479
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
commandlineparser/commandline 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
commandlineparser/commandline#951 · 1 則留言 ·
-
難度 1/5 1 小時以內 新手友好度 70/100
commandlineparser/commandline#880 · 2 個 reaction ·
-
難度 5/5 一週以上 新手友好度 45/100
commandlineparser/commandline#952 ·
-
難度 3/5 1-2 天 新手友好度 35/100
commandlineparser/commandline#948 ·
-
難度 5/5 一週以上 新手友好度 35/100
commandlineparser/commandline#947 ·
查看 commandlineparser/commandline 的全部 Issue
相似的 Issue
-
type/automation type/tech-debt
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
area-integrations
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
:watch: Not Triaged dotnet-framework/svc install-deployment/subsvc
難度 1/5 1 小時以內 新手友好度 75/100
維護者通常 1 天內回覆
-
has-image has-readme needs-attention new-tool repo-verified
難度 1/5 1-3 小時 新手友好度 62/100
shanselman/TinyToolTown#844 · 2 則留言 ·
維護者通常 3 天內回覆
-
:watch: Not Triaged Pri3
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆