简体   繁体   English

使用buildpublisher发布ASP.NET网站

[英]Publishing an ASP.NET Website using buildpublisher

I am using the Cruise Control BuildPublisher task to publish a 2005 ASP.NET website. 我正在使用Cruise Control BuildPublisher任务来发布2005 ASP.NET网站。 The Website has no warnings and if I run the Publish WebSite from within the IDE it works fine. 该网站没有警告,如果我在IDE中运行发布网站,则可以正常运行。

When I publish through Cruise Control however it only publishes the bin folder and the PrecompiledApp.config. 但是,当我通过Cruise Control发布时,它仅发布bin文件夹和PrecompiledApp.config。 All ASPX files are excluded. 排除所有ASPX文件。

I have tried this before on a previous project with no issue. 我以前在没有问题的先前项目中尝试过此方法。

In general, I have found that putting as much logic as possible into an MSBuild (or nAnt if that's your thing) file and as little as possible into the CCNet file is the way to go. 总的来说,我发现应该将尽可能多的逻辑放入MSBuild(或nAnt,如果是这样的话)文件中,并将尽可能少的逻辑放入CCNet文件中。

If this approach works for your environment, you can create an MSBuild target that puts the files you need into a group, like this: 如果此方法适用于您的环境,则可以创建一个MSBuild目标,将所需文件放入组中,如下所示:

<ItemGroup>
    <DeployFiles Include = "*.aspx"/>
    etc.
</ItemGroup>

And then add a copy task to deploy your files to the appropriate place: 然后添加复制任务以将文件部署到适当的位置:

<Copy SourceFiles="@(DeployFiles)" DestinationFolder="\\someserver\builds\$(CCNetLabel)">

Very important: If you have your compilation task in the same MSBuild file, you will want to make this copying business a separate call to MSBuild. 非常重要:如果您的编译任务在同一个MSBuild文件中,则需要将此复制业务作为对MSBuild的单独调用。 This is because the DeployFiles ItemGroup will be evaluated right away. 这是因为将立即评估DeployFiles ItemGroup。 Any new files that match the DeployFiles filters will not be included when it's time to deploy the build. 在部署构建时,将不包括与DeployFiles筛选器匹配的任何新文件。 Very annoying. 很烦人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM