如何解决vscode ubuntu asp .net core 3.1服务在调用api请求时立即以代码0退出
在ubuntu asp.net core 3.1服务中的vscode中调试时,此服务将启动并在ip:port上侦听。问题是,如果我在该ip:port上发送api请求,服务将立即退出,代码为0。
Hosting environment: Development
Content root path: /home/name/project
Now listening on: http://0.0.0.0:5020
Application started. Press Ctrl+C to shut down.
The program '[11834] WebService.dll' has exited with code 0 (0x0).
如果使用dotnet run命令运行服务,则不会出现此问题,但是我无法调试。
请问我的launch.json和task.json是否有问题?
launch.json
{
"version": "0.2.0","configurations": [
{
"name": ".NET Core Launch (console)","type": "coreclr","request": "launch","preLaunchTask": "build","program": "${workspaceFolder}/path/bin/Debug/netcoreapp3.1/WebService.dll","args": ["--urls","http://0.0.0.0:5020"],"cwd": "${workspaceFolder}","stopAtEntry": false,"console": "internalConsole","env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},},{
"name": ".NET Core Attach","request": "attach","processId": "${command:pickProcess}"
}
]
}
task.json
{
"version": "2.0.0","tasks": [
{
"label": "build","command": "dotnet","type": "shell","args": [
"build","/property:GenerateFullPaths=true","/consoleloggerparameters:NoSummary"
],"group": "build","presentation": {
"reveal": "silent"
},"problemMatcher": "$msCompile"
}
]
}
谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。