2

在Visual Studio 2015社区版中,我通过控制台运行我的.NET Core Web API应用程序,方法是从工具栏上的运行配置文件选项中选择[AppName](近小绿色三角形,下拉菜单)在我之前的项目中。默认选项是IIS Express和[AppName],它运行从命令提示符运行的dotnet恢复和dotnet。在VS2015中通​​过控制台运行.NET Core应用程序

当我重新安装Windows 10,因此VS2015,当我创建一个新的项目时,我不能再在下拉菜单中看到默认[AppName]选项。它只有一个选项,即IISExpress。

The dropdown menu for running options

我怎样才能重新启用?我还为VS2015安装了网络核心工具。

谢谢。

回答

0

我找到了解决方案。

在Solution Explorer中> YourProject>属性> launchSettings.json, 你应该profiles添加此到:

"YourProjectName": { 
    "commandName": "Project", 
    "launchBrowser": true, 
    "launchUrl": "http://localhost:5000", 
    "environmentVariables": { 
    "ASPNETCORE_ENVIRONMENT": "Development" 
    } 

然后你就可以改变启动选项:

enter image description here

相关问题