`net6`(而不是`net6.0`)是有效的目标框架数值吗?

huangapple go评论69阅读模式
英文:

Is the `net6` (not `net6.0`) is a valid target framework value?

问题

有时我看到项目的目标框架设置为net6(而不是net6.0)在其'csproj'文件中。

net6-macos;net6-windows

这样的项目可以构建并正常运行。
与此同时,文档中仅列出了像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.

huangapple
  • 本文由 发表于 2023年3月15日 20:30:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75744714.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定