[英]Visual Studio Code .NET Core - Launch (web) does not start the browser
I am trying to debug a .NET Core WebApi application on Red Hat Linux. 我正在尝试在Red Hat Linux上调试.NET Core WebApi应用程序。 But when I press F5 I get the following in the DEBUG CONSOLE and the browser does not start. 但是,当我按F5键时,在DEBUG CONSOLE中得到以下内容,并且浏览器无法启动。 Thank You 谢谢
Module is optimized and the debugger option 'Just My Code' is enabled. 模块已优化,调试器选项“ Just My Code”已启用。 The program '[4657] TodoApi.dll' has exited with code 0 (0x0). 程序“ [4657] TodoApi.dll”已退出,代码为0(0x0)。
here's what's in the launch.json file 这是launch.json文件中的内容
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/TodoApi.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open http://localhost:5000/api/values"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
You should place ' http://localhost:5000/api/values ' within the "args"
section instead of appending to the "command"
section. 您应将“ http:// localhost:5000 / api / values ”放置在"args"
部分中,而不是附加到"command"
部分中。
So the code, in your case, will be something like: 因此,根据您的情况,代码将类似于:
"linux": {
"command": "xdg-open",
"args": "http://localhost:5000/api/values"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.