VisualStudio未显示WSL2启动配置文件
c#
c#-9.0
我刚刚将我的 Visual Studio 社区 2019 更新到了 16.9.1 版。但是我看不到本文档中提到的 WSL2 配置文件。
此外,我的机器具有所有先决条件。
我已尝试使用现有和新的控制台应用程序、目标框架为 .net core 3.1 和 .NET 5 的 Web 应用程序,但未显示该选项。
另外,我尝试将以下设置添加到 launchSettings.json 文件中,但是在使用此更改运行时,它显示错误
该项目不知道如何运行 Profile WSL 2。
"WSL 2": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "https://localhost:5001",
"environmentVariables": {
"ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000",
"ASPNETCORE_ENVIRONMENT": "Development"
},
"distributionName": ""
}
回答
请检查您是否安装了以下组件。因为我们需要手动安装。