我的VS Code工作区文件包含启动配置和任务部分,因此开发人员可以在本地运行Azure Functions。
但是,它暗示了将忽略工作空间文件中的启动配置。
如果我将launch.json
和tasks.json
添加到相同的内容,它将正常工作。
.code-workspace
:
{
"folders": [
{
"path": "."
}
],"launch": {
"configurations": [
{
"name": "Attach to .NET Functions","type": "coreclr","request": "attach","processId": "${command:azureFunctions.pickProcess}"
}
]
},"tasks": {
"version": "2.0.0","tasks": [
{
"label": "clean","command": "dotnet","args": [
"clean","/property:GenerateFullPaths=true","/consoleloggerparameters:NoSummary"
],"type": "process","problemMatcher": "$msCompile"
},{
"label": "build","args": [
"build","dependsOn": "clean","group": {
"kind": "build","isDefault": true
},{
"label": "clean release","--configuration","Release",{
"label": "publish","args": [
"publish","dependsOn": "clean release",{
"type": "func","dependsOn": "build","options": {
"cwd": "${workspaceFolder}/src/ProjectAbc/bin/Debug/netcoreapp2.2"
},"command": "host start","isBackground": true,"problemMatcher": "$func-watch"
}
]
}
}
预期行为:
如果我按F5
,则应使用工作区设置中的lauch配置来构建和运行Azure函数。
实际行为:
如果我按F5
,VS Code会根据环境创建一个launch.json
文件。