正式发布 | .NET 7 预览版 2( 二 )


dotnet CLI 在 PowerShell、bash、zsh 和 fish 等流行的 shell 上支持 tab 补全已经有一段时间了(有关如何启用它的说明 , 请参阅如何为 .NET CLI 启用 TAB 补全) 。 然而 , 实现有意义的补全取决于单独的dotnet命令 。 对于 .NET 7 , new 命令学习了如何提供 Tab 自动补全 。

  • 可用的模板名称(in dotnet new <template-short-name>)
? dotnet new angularangular grpc razor viewstart worker -hblazorserver mstest razorclasslib web wpf /? blazorwasm mvc razorcomponent webapi wpfcustomcontrollib /hclasslib nugetconfig react webapp wpflib install console nunit reactredux webconfig wpfusercontrollib listeditorconfig nunit-test sln winforms xunit search gitignore page tool-manifest wnformscontrollib --help uninstall globaljson proto viewimports winformslib -? update
  • 模板选项( Web模板中的模板选项列表)
? dotnet new web --dry-run--dry-run --language --output -lang--exclude-launch-settings --name --type -n--force --no-https -? -o--framework --no-restore -f /?--help --no-update-check -h /h
  • 这些模板选项的允许值(选择模板参数上的选择值)
? dotnet new blazorserver --auth IndividualIndividual IndividualB2C MultiOrg None SingleOrg Windows当然也有一些已知的差距——例如 , -- language 不建议安装语言值 。
  • 未来的工作
在未来的预览版中 , 我们计划继续填补这一过渡留下的空白 , 并让自动完成或像用户可以执行的单个命令一样简单 。 我们希望这将改进整个 dotnet CLI 的 Tab 补全功能 , 并被社区更广泛地使用!
  • 下一步是什么
dotnet new users – 启用Tab补全并尝试使用模板!模板作者 – 在您的模板上尝试Tab补全 , 并确保您提供您希望您的用户拥有的体验 。 提出您在dotnet/templating 存储库中发现的任何问题 , 并帮助我们使 .NET 7 成为 dotnet new 的最佳版本!
  • NativeAOT 更新
我们之前宣布 , 我们正在将 NativeAOT 项目从实验状态转移到 .NET 7 的主线开发中 。 在过去的几个月里 , 我们一直在埋头进行编码 , 以将 NativeAOT 从实验性dotnet/runtimelab repo中移出并进入dotnet/runtime repo 。
该工作现已完成 , 但我们尚未在 dotnet SDK 中添加支持 , 来使用 NativeAOT 发布项目 。 我们希望尽快完成这项工作 , 以便您可以在您的应用程序中试用 NativeAOT 。 同时 , 请尝试修剪您的应用并确保没有修剪警告 。 修剪是 NativeAOT 的要求 。 如果您拥有任何库 , 请参考准备进行修剪库的说明 。
  • 引入新的正则表达式源生成器
    https://github.com/dotnet/runtime/issues/44676
  • [Epic] 新的 CLI 解析器 + 选项卡完成 #2191
    https://github.com/dotnet/templating/issues/2191
  • 如何为 .NET CLI 启用 TAB 补全
    https://docs.microsoft.com/dotnet/core/tools/enable-tab-autocomplete
  • dotnet/templating 存储库中问题解决方案
    https://github.com/dotnet/templating/issues/2191
  • NativeAOT 项目
    https://github.com/dotnet/runtime/issues/61231
  • dotnet/runtimelab repo中移出
    https://github.com/dotnet/runtimelab
  • dotnet/runtime
    https://github.com/dotnet/runtimelab
  • 应用
    https://docs.microsoft.com/dotnet/core/deploying/trimming/trim-self-contained
  • 准备进行修剪库的说明
    https://docs.microsoft.com/dotnet/core/deploying/trimming/prepare-libraries-for-trimming
Targeting .NET 7
要targeting .NET 7 , 您需要在项目文件中使用 .NET 7 Target Framework Moniker (TFM) 。 例如:

特别声明:本站内容均来自网友提供或互联网,仅供参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。