英文:
Is the `net6` (not `net6.0`) is a valid target framework value?
问题
有时我看到项目的目标框架设置为net6
(而不是net6.0
)在其'csproj'文件中。
这样的项目可以构建并正常运行。
与此同时,文档中仅列出了像net6.0
这样的值作为sdk-style项目的目标框架的有效选项。
因此,问题是:net6
的tfm是否是偶然工作的,还是设计上有效的值?使用net6
是否应该被视为一个错误并修复为net6.0
?
英文:
Some times I see the projects with target framework set to the net6
(not net6.0
) in its 'csproj' files.
<TargetFrameworks>net6-macos;net6-windows</TargetFrameworks>
Such a projects builds and works without problems.
At the same time documentation lists only net6.0
-like values as a valid for the target framework in sdk-style projects.
So, the question is: does net6
tfm works by accident or it's a valid value by design? Should the usage of net6
be considered as a bug and fixed to the net6.0
?
答案1
得分: 0
总结:没有任何证据表明net6
是经过设计有效的 TFM(目标框架单元)。
此外,一些工具无法正确处理这种 TFM。例如,使用 VS for Mac 在项目中编辑 xib/storyboard 时,如果依赖关系树中有不正确的 TFM,则会引发"Error updating Objective-C type information"错误(社区报告1)。
因此,最好将net6
TFM 视为错误,并使用net6.0
来修复它,以避免在某些用例中出现非常不可预测和令人吃惊的效果。
英文:
As conclusion: there is no any evidences that net6
is a valid tfm by design.
Moreover, some tooling unable to work correctly with such a tfm. For example, VS for Mac will throw "Error updating Objective-C type information" error when trying to edit xib/storyboard in the project where there is incorrect tfm somewhere in the dependencies tree (community report).
So, it's better to treat net6
tfm as an error and fix it with net6.0
to avoid some very unpredictable and surprising effects in some use cases.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论