Dotnet CLI 热重载:总是在粗鲁编辑时重启应用程序?
Dotnet CLI Hot Reload: always restart app on rude edits?
在 .NET CLI 中使用 Hot Reload 时...
$ dotnet watch
watch : Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. Press "Ctrl + R" to restart.
watch : Building...
...
watch : Started
...任何粗鲁的编辑都会导致以下提示:
watch : Unable to apply hot reload because of a rude edit.
watch : Do you want to restart your app - Yes (y) / No (n) / Always (a) / Never (v)?
有什么方法可以让 CLI 默认为“始终”吗?类似于 dotnet watch --always-restart
?
(询问是因为我想 运行 dotnet watch
在容器中)
事实证明,yes!
$ export DOTNET_WATCH_RESTART_ON_RUDE_EDIT=1
$ dotnet watch
(.NET 6.0.2+)
在 .NET CLI 中使用 Hot Reload 时...
$ dotnet watch
watch : Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. Press "Ctrl + R" to restart.
watch : Building...
...
watch : Started
...任何粗鲁的编辑都会导致以下提示:
watch : Unable to apply hot reload because of a rude edit.
watch : Do you want to restart your app - Yes (y) / No (n) / Always (a) / Never (v)?
有什么方法可以让 CLI 默认为“始终”吗?类似于 dotnet watch --always-restart
?
(询问是因为我想 运行 dotnet watch
在容器中)
事实证明,yes!
$ export DOTNET_WATCH_RESTART_ON_RUDE_EDIT=1
$ dotnet watch
(.NET 6.0.2+)