Team Foundation Build - 解决跨解决方案项目引用
我们有一个跨多个解决方案引用的共享项目,当 TF 构建遇到该问题时,会导致:
“错误 MSB3202:未找到项目文件“......\trunk\\\sharedproject.csproj””。
这很好,因为构建服务器上的目录结构不反映源代码控制的目录结构。是否可以修改构建文件以在特定位置搜索该项目?
We have a shared project referenced across multiple solutions which, when encountered by TF build causes:
'error MSB3202: The project file "......\trunk\\\sharedproject.csproj" was not found'.
This is fine as the directory structure on the build server does not reflect that of source control. Is it possible to modify the build file to search in a specific location for this project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您应该考虑添加对共享项目的 dll 引用而不是项目引用,然后将该 dll 包含在源代码管理中。如果这不是一个选项,您始终可以创建另一个解决方案文件,该文件引用构建服务器上共享项目文件的正确路径,并在构建服务器上使用该解决方案。不过,我倾向于 dll 参考,因为从长远来看,选项二更难维护。
希望有帮助。
/克劳斯
Maybe you should consider adding a dll reference to the shared project instead of a project reference, and then include the dll in your source control. If that is not an option, you could always create another solution file that references the correct path of the share project file on your build server, and use that solution on your build server. I'm inclined to the dll reference though, since option two is harder to maintain in the long run.
Hope it helps.
/Klaus
我使用构建定义中的“工作空间”选项卡解决了这个问题。
我的解决方案文件引用当前项目之外的项目,例如 $/Common 项目。
为了使自动构建工作,需要正确映射构建代理上的工作区。查看生成的错误,我可以确定文件夹的位置。
因此,我的工作文件夹中列出了几个不同的项目,其中构建代理文件夹是构建代理计算机上的位置,而不是我的本地计算机(这让我陷入了困境)。一切都在构建代理上构建,然后复制到输出目录。
I solved this problem using the Workspace tab in the build definition.
My solution file references projects that are outside of the current project, such as a $/Common project.
For an automated build to work, the workspace on the build agent needed to be correctly mapped. Looking at the error generated, I could determine where the folders were expected to be.
So my Working Folders has a few different projects listed in it, with the Build Agent Folder being the location on the Build Agent computer, not my local computer (that threw me for a loop). Everything is built on the build agent, and then copied to an output directory.