我将Visual Studio与ASP.NET Core结合使用,并仅使用F5或Ctrl + F5(而不是直接使用命令行)来运行网站。我想使用“ dotnet watch”功能来确保所有更改都在进行中,以避免再次启动服务器。似乎在命令行中您将为此使用“ dotnet watch run”,但是Visual Studio使用launchSettings.json并在我理解正确的情况下在后台进行操作。
如何在那里连接“ dotnet监视”?
打开launchSettings.json并将其添加到中profiles
。
"Watch": {
"executablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
"commandLineArgs": "watch run",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
打开project.json并将其添加到中tools
。
"Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final"
还原后,我们可以在Visual Studio中观看。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句