我在visual studio代码中创建了一个空的Web应用程序。但是当使用" dotnet run"运行它时它没有打开任何浏览器 它只显示以下行。
>C:\Users\viru babu\Documents\MVCcoreLinkdin>dotnet run
>Hosting environment: Production
>Content root path: C:\Users\viru babu\Documents\MVCcoreLinkdin
>Now listening on: http://localhost:5000
>Application started. Press Ctrl+C to shut down.
答案 0 :(得分:0)
要在http://localhost:5000
上自动打开浏览器,您可以添加配置到launch.json
。添加如下配置:
{
"name": "Chrome",
"type": "chrome",
"runtimeExecutable": "./path/to/chrome.exe",
"request": "launch",
"url": "http://localhost:5000",
"webRoot": "${workspaceRoot}", // maybe you need to adjust this entry to "C:\Users\viru babu\Documents\MVCcoreLinkdin"
"preLaunchTask": "shell: dotnet run" // add prelaunch task start (defined in tasks.json)
}
也可以自动启动您的应用程序,使用preLaunchTask
。为此,您需要在运行命令tasks.json
的{{1}}中配置custom task。