构建引用其他 class 库的项目(缺少程序集)

Building Projects that reference other class libraries (missing assembly)

我正在使用 Visual Studio Team Services 为我的项目配置 CI。解决方案结构如下所示:

+MyApplications
   +.nuget
      NuGet.Config
   +Packages
   +AdminWebApp     ---> ("AdminWebApp" references the class library "AdminClassLib")
   +ClientWebApp    ---> ("ClientWebApp" references the class library "ClientClassLib")
   +AdminClassLib
   +ClientClassLib
   MyApplications.sln

我创建了一个构建定义,用于构建一个 Web 应用程序(管理员)以在稍后阶段发布它。 AdminWeb 构建定义具有以下任务:

->Nugget 安装程序

->Visual Studio 构建

存储库仅映射到 "AdminWebApp"。

构建过程失败,出现以下错误:

Error CS0246: The type or namespace name 'AdminClassLib' could not be found (are you missing a using directive or an assembly reference?)
Warning : The referenced project '..\AdminClassLib\AdminClassLib.csproj' does not exist.

在 Visual Studio 中,它构建成功,因为我猜它编译了所有项目并构建了依赖项。

是否有任何有用的信息来说明如何使用 Visual Studio 团队服务来做到这一点?

没有引用的项目,Team Build 将无法找到未在构建中生成的二进制文件。

它可能是在本地构建的,因为 .csproj 在那里,或者二进制文件仍然存在,形成了以前的构建。

要么将项目包含在您的构建工作区中,要么配置您的 AdminClassLib 构建定义以将其发布为 NuGet 包。您可以使用 VSTeam 服务的包管理功能来存储您的包。

然后您可以将 WebUI 配置为从私有 NuGet 存储库中获取最新版本的 AdminClassLib。