.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
- 派生
- 478
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 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
-
area-ai untriaged
难度 2/5 1-3 小时 新手友好度 85/100
dotnet/extensions#7790 ·
维护者通常 1 天内回复
-
P2 testing
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
area-Infrastructure-coreclr os-ios os-maccatalyst os-tvos untriaged
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#134766 · 3 条评论 ·
维护者通常 1 天内回复
-
0 - Backlog Bug
难度 2/5 1-3 小时 新手友好度 88/100
BrighterCommand/Brighter#4444 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复