为什么 TeamCity 会丢失引用并导致编译失败?

发布于 2024-08-20 16:24:40 字数 434 浏览 3 评论 0原文

我对 TeamCity 完全陌生,我正在使用简单的 Visual Studio 2008 解决方案来学习它。

我的解决方案有 2 个项目:ConsoleApplication1 和 ClassLibrary1。

ConsoleApplication1 具有对 ClassLibrary1 的引用。该解决方案直接在VS中编译没有问题。

但是,当我尝试在 TeamCity 中编译相同的解决方案时,它失败并出现错误:

Program.cs(13, 25): 错误 CS0246: 类型或命名空间名称“ClassLibrary1” 找不到(您是否缺少 使用指令或程序集 参考?)

据我了解,.sln 文件包含检索依赖项项目所需的信息。

我可以做什么来帮助 TeamCity 编译解决方案?

I'm completely new to TeamCity and I'm using a simple Visual Studio 2008 solution to learn it.

My solution has 2 projects: ConsoleApplication1 and ClassLibrary1.

ConsoleApplication1 has a reference to ClassLibrary1. The solution compiles with no problem in VS directly.

However, when I try to compile the same solution in TeamCity, it fails with error:

Program.cs(13, 25): error CS0246: The
type or namespace name 'ClassLibrary1'
could not be found (are you missing a
using directive or an assembly
reference?)

As far as I understand, the .sln file contains the required information to retrieve the dependency project.

What can I do help TeamCity cmpile the solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

骄兵必败 2024-08-27 16:24:40

检查构建日志中是否有任何 MSBuild 产生的错误和警告。

检查您是否定义了对项目的引用,但没有定义对项目输出的引用。

检查ClassLibrary1编译是否成功。

是的,.sln 文件应包含所需的信息。

您能否尝试使用 msbuild.exe 从控制台运行构建?有效吗?
msbuild.exe mySolution.sln /t:Rebuild

尝试设置目标 Rebuild

使用什么用户帐户来运行构建代理 Windows 服务?

Check the build log for any MSBuild produced errors and warnings.

Check you have defined a reference to the project, but not to the output of the project.

Check the compilation of ClassLibrary1 succeedes.

Yes, .sln file should contain the required information.

Could you please try running the build from console using msbuild.exe. Does it work?
msbuild.exe mySolution.sln /t:Rebuild

Try settings target Rebuild

What user account is used to run build agent windows service?

扶醉桌前 2024-08-27 16:24:40

问题是 .sln 文件在存储库的两个不同位置重复,并且我将 TeamCity 配置为构建错误的文件...

The problem was that the .sln file was repeated on the repository, on two different locations, and I configured the TeamCity to build the wrong one...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文