IntelliSense 不适用于子项目中的 NuGet 包

IntelliSense not working for NuGet packages in sub-project

我有一个具有以下文件夹结构的 Azure Functions 项目:

SyncAgent.Data 子项目是使用命令 dotnet new classlib --framework netcoreapp2.2

创建的

在同一目录中,然后我 运行 dotnet add package Microsoft.Azure.DocumentDB.CoreData 子项目安装 DocumentDB 包。

DocumentRepository class 包含连接到 CosmosDB 和添加文档的代码。 SyncAgent.csproj 文件包含 SyncAgentData.csprojSyncPartnerCustomers class 中的 Azure 函数调用 DocumentRepository class.

中的代码

使用 VS Code 调试器执行时,代码按预期运行,没有错误。问题是 IntelliSense 无法识别子项目中的 Microsoft.Azure.Documents 命名空间。

尽管代码运行没有错误,但为什么 IntelliSense 无法检测到命名空间?

不确定出了什么问题,但删除所有临时 binobj 文件夹重新启动 VS Code 并重新构建项目似乎可以解决问题。