拆分构建成多个输出目录 [英] Splitting a build into multiple output directories

查看:354
本文介绍了拆分构建成多个输出目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用NServicebus其中至少包含3个项目是为这种情况的利益的解决方案;发布者,扫描和web服务。基本上扫描(多个)收集数据用于发布到存储在数据库中,然后发布给用户。 web服务可以访问存储在出版商数据库中的数据。

I have a solution that uses NServicebus which contains at least 3 projects that are of interest for this scenario; a publisher, a sweep, and a webservice. Basically the sweep(s) gather data for the publisher to store in a database and then publish to subscribers. The webservice gives access to the data stored in the publishers database.

当我建我的dev的盒子这个解决方案并将其部署到测试环境一切都很好。上周,我们开始使用自动化构建一个构建服务器上,虽然它成功生成,这些服务将不会在测试环境中启动。我发现这是因为NServicesBus使用标记接口。该NServicesBus通用主机使用反射来检查程序集在同一目录作为东道主为那些标记,所以它知道这火起来。我不像本地构建构建服务器的每个项目未生成到它自己的bin目录,它只是转储所有程序集到一个单一的bin目录。因为现在有希望由主机启动多个类,这是行不通的。此外,Web服务有很多组件包含比出版商和扫描需要那么最终的结果是一样的组件部署到三个不同的目录。这是不必要的,是行不通的。

When I built this solution on my dev box and deployed to the test environment everything was fine. Last week we started using automated builds on a build server and while it builds successfully, the services would not start up in the test environment. I found this to be because NServicesBus uses marker interfaces. The NServicesBus generic host uses reflection to check assemblies in the same directory as the host for those markers so it knows which to fire up. Unlike my local build the build server does not build each project into it's own bin directory, it just dumps all the assemblies into a single bin directory. Since there are now multiple classes that want to be started by the host, it doesn't work out. Also, the webservice has a lot more assemblies to include than the publisher and sweep need so the end result is the same assemblies get deployed to three different directories. It's unnecessary and doesn't work.

我已经修改构建像这样来解决这个问题,但它是单调乏味的,它不是改变宽容的:

I've been modifying the build like so to get around this, but it's tedious and it's not change tolerant:

<CreateItem Include="$(OutDir)*.*" Exclude="$(OutDir)BOHSweep*">
  <Output ItemName="PublisherFilesToCopy" TaskParameter="Include" />
</CreateItem>

<CreateItem Include="$(OutDir)*.*" Exclude="$(OutDir)InventoryPublisher*">
  <Output ItemName="BOHSweepFilesToCopy" TaskParameter="Include" />
</CreateItem>

<Copy SourceFiles="@(PublisherFilesToCopy)" DestinationFolder="\\XXXX\Transmittals\BOHPublisher\Test\%(RecursiveDir)" />
<Copy SourceFiles="@(BOHSweepFilesToCopy)" DestinationFolder="\\XXXX\Transmittals\BOHSweep\Test\%(RecursiveDir)" />

如何解决这个问题?任何建议,飘逸

Any elegant suggestions on how to tackle this issue?

推荐答案

您应该能够使用在这里找到了该技术:<一href=\"http://blogs.msdn.com/b/aaronhallberg/archive/2007/06/07/$p$pserving-output-directory-structures-in-orcas-team-build.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/aaronhallberg/archive/2007/06/07/$p$pserving-output-directory-structures-in-orcas-team-build.aspx

You should be able to use the technique found here: http://blogs.msdn.com/b/aaronhallberg/archive/2007/06/07/preserving-output-directory-structures-in-orcas-team-build.aspx

这篇关于拆分构建成多个输出目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆