0

我创建了一个非常简单的持久功能应用程序进行测试。它有 3 个文件(starter、orchestrator、activity)和一个 .csproj,以及正常的样板文件(host.json 等)

当 4 个主文件位于根目录时,该功能运行良好。我正在使用 VS 代码。我只是调试并“附加到 C# 函数”。

如果我将这 4 个文件移动到它们自己的目录并.csproj使用.sln文件注册,删除根目录中的bin/obj文件夹,我会收到错误消息。

chdir(2) failed.: No such file or directory
The terminal process terminated with exit code: 1

我需要做什么来告诉 Functions 我的函数在一个目录下?

4

1 回答 1

1

发现问题。VS Code 获取它运行的命令.vscode/tasks.json。有一个标记为“运行功能主机”。这options.cwd是它最终运行的命令。您只需要在其中添加目录

  "label": "Run Functions Host",
  "identifier": "runFunctionsHost",
  "type": "shell",
  "dependsOn": "build",
  "options": {
    "cwd": "${workspaceFolder}/DIRECTORY_NAME/bin/Debug/netstandard2.0"
  },
于 2018-10-10T18:36:21.160 回答