构建成功,但无法找到二进制文件。为什么?

时间:2023-01-17 11:28:27

Recently I've changed our team build project file from:

最近我改变了我们的团队构建项目文件:

<SolutionToBuild Include="$(SolutionRoot)/OurSolution.sln">

to

<SolutionToBuild Include="$(SolutionRoot)/**/*.csproj">

This was necessary because we have many projects which are not contained in the solution file, and for our purposes it is not feasible to just add the projects. We would like to be able to build them all in one go. So we found a way to recursively build all the projects.

这是必要的,因为我们有许多项目未包含在解决方案文件中,而且出于我们的目的,仅添加项目是不可行的。我们希望能够一次性构建它们。所以我们找到了一种递归构建所有项目的方法。

This works fine and the build can be done with no errors. The only problem is there are no binaries copied to the drop folder! In fact, we can't find them anywhere! Building from the solution, the binaries are copied to a Binaries folder on the build agent. But nothing is there when building from the individual projects.

这很好,构建可以没有错误。唯一的问题是没有二进制文件复制到drop文件夹!事实上,我们无法在任何地方找到它们!从解决方案构建,二进制文件将复制到构建代理程序上的Binaries文件夹中。但是从单个项目构建时没有任何东西。

So my question is, where are they? Why does team build report that everything built fine, but then nothing is there to be copied. They aren't even in the normal bin/Release folder under the project directory.

所以我的问题是,他们在哪里?为什么团队构建报告所有内容都很好,但是没有什么可以复制的。它们甚至不在项目目录下的普通bin / Release文件夹中。

Can someone help me understand? I feel it probably has something to do with information contained in the solution file which is not present in the project files, but I can't figure it out.

有人可以帮我理解吗?我觉得它可能与解决方案文件中包含的信息有关,项目文件中没有这些信息,但我无法弄清楚。

2 个解决方案

#1


I think that the SolutionToBuild item is empty and nothing is getting built. You can verify by

我认为SolutionToBuild项是空的,没有任何内容构建。你可以验证

<Message Text="SolutionToBuild: $(SolutionToBuild)" Importance="high"/>

Then look through your log for that statement.

然后查看您的日志以查找该语句。

You may want to revise your approach in any case. Better would be to create an MSBuild file yourself, i.e. BuildAll.proj. In that file just use the MSBuild task to build all the projects. Then set that file to be the SolutionToBuild. This will give you some more flexibilty when the projects are getting built. You can add steps before/after the build for those projects or all of them.

在任何情况下,您可能都想修改您的方法。更好的方法是自己创建一个MSBuild文件,即BuildAll.proj。在该文件中,只需使用MSBuild任务即可构建所有项目。然后将该文件设置为SolutionToBuild。在项目构建时,这将为您提供更多灵活性。您可以在构建之前/之后为这些项目或所有项目添加步骤。

Sayed Ibrahim Hashimi

Sayed Ibrahim Hashimi

My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build

我的书:Microsoft Build Engine内部:使用MSBuild和Team Foundation Build

#2


Have you looked through the TFSBuild logs. If you have TFS 2008 the logs have lots of crunchy details that the TFS 2005 did not have.

你看过TFSBuild日志了吗?如果您有TFS 2008,则日志中包含许多TFS 2005没有的脆弱细节。

Another thought is to fire up FileMon and watch for files created by the TFSBuild service.

另一个想法是启动FileMon并监视由TFSBuild服务创建的文件。

#1


I think that the SolutionToBuild item is empty and nothing is getting built. You can verify by

我认为SolutionToBuild项是空的,没有任何内容构建。你可以验证

<Message Text="SolutionToBuild: $(SolutionToBuild)" Importance="high"/>

Then look through your log for that statement.

然后查看您的日志以查找该语句。

You may want to revise your approach in any case. Better would be to create an MSBuild file yourself, i.e. BuildAll.proj. In that file just use the MSBuild task to build all the projects. Then set that file to be the SolutionToBuild. This will give you some more flexibilty when the projects are getting built. You can add steps before/after the build for those projects or all of them.

在任何情况下,您可能都想修改您的方法。更好的方法是自己创建一个MSBuild文件,即BuildAll.proj。在该文件中,只需使用MSBuild任务即可构建所有项目。然后将该文件设置为SolutionToBuild。在项目构建时,这将为您提供更多灵活性。您可以在构建之前/之后为这些项目或所有项目添加步骤。

Sayed Ibrahim Hashimi

Sayed Ibrahim Hashimi

My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build

我的书:Microsoft Build Engine内部:使用MSBuild和Team Foundation Build

#2


Have you looked through the TFSBuild logs. If you have TFS 2008 the logs have lots of crunchy details that the TFS 2005 did not have.

你看过TFSBuild日志了吗?如果您有TFS 2008,则日志中包含许多TFS 2005没有的脆弱细节。

Another thought is to fire up FileMon and watch for files created by the TFSBuild service.

另一个想法是启动FileMon并监视由TFSBuild服务创建的文件。