2011-07-07 34 views
4

我在命令行上使用MSBUILD时遇到了一些问题,因为结果不同,我不明白为什么会这样。MSBUILD在命令行创建_PublishedWebsites,但不在CI服务器上

在调用MSBUILD时在本地机器上的命令行中,项目被构建,输出目录包含一堆DLL和PDB文件,以及一个名为_PublishedWebsites的子目录,其中包含我的解决方案中的两个Web应用程序(一个ASP.NET MVC应用程序和WCF Web服务)。

到目前为止这么好。

在CI服务器上,该文件夹没有被创建。

这是两个同时使用的msbuild项目文件,所以我看不出有什么区别可能。经过几个小时的谷歌搜索后,我现在处于完全失利状态。

我假设在我的本地机器上的环境中设置了某个不存在于CI服务器上的默认设置。

是否有任何特定的选项我必须设置某处以显示告诉MSBUILD创建一个文件夹包含已发布的Web应用程序?

UPDATE的的ccnet.config(部分)

<cruisecontrol> 
    <!-- Other projects here --> 
    <project name="My-Project Nightly Build"> 
    <workingDirectory>C:\CruiseControl\My-Project-Nightly</workingDirectory> 
    <artifactDirectory>C:\CruiseControlArtifacts\My-Project-Nightly</artifactDirectory> 

    <sourcecontrol type="multi"> 
     <sourceControls> 
     <vsts> 
      <executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable> 
      <project>$/Brand Web/</project> 
      <autoGetSource>true</autoGetSource> 
      <applyLabel>true</applyLabel> 
      <cleanCopy>true</cleanCopy> 
      <deleteWorkspace>true</deleteWorkspace> 
      <server>http://company-tfs:8080/tfs/Projects</server> 
      <workingDirectory>C:\CruiseControl\My-Project-Nightly\Brand Web\</workingDirectory> 
      <workspace>Brand-Nightly</workspace> 
     </vsts> 

     <vsts> 
      <executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable> 
      <project>$/Brand/Main</project> 
      <autoGetSource>true</autoGetSource> 
      <applyLabel>true</applyLabel> 
      <cleanCopy>false</cleanCopy> 
      <server>http://company-tfs:8080/tfs/Projects</server> 
      <workingDirectory>C:\CruiseControl\My-Project-Nightly\Brand\Main</workingDirectory> 
      <workspace>Brand-Nightly</workspace> 
     </vsts> 
     <vsts> 
      <executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable> 
      <project>$/Generic</project> 
      <autoGetSource>true</autoGetSource> 
      <applyLabel>true</applyLabel> 
      <cleanCopy>false</cleanCopy> 
      <server>http://company-tfs:8080/tfs/Projects</server> 
      <workingDirectory>C:\CruiseControl\My-Project-Nightly\Generic</workingDirectory> 
      <workspace>Brand-Nightly</workspace> 
     </vsts> 

     <vsts> 
      <project>$/ComponentA</project> 
      <executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable> 
      <autoGetSource>true</autoGetSource> 
      <applyLabel>true</applyLabel> 
      <cleanCopy>false</cleanCopy> 
      <server>http://company-tfs:8080/tfs/Projects</server> 
      <workingDirectory>C:\CruiseControl\My-Project-Nightly\ComponentA</workingDirectory> 
      <workspace>Brand-Nightly</workspace> 
     </vsts> 

     <vsts> 
      <project>$/Third Party Libraries</project> 
      <executable>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe</executable> 
      <autoGetSource>true</autoGetSource> 
      <applyLabel>true</applyLabel> 
      <cleanCopy>false</cleanCopy> 
      <server>http://company-tfs:8080/tfs/Projects</server> 
      <workingDirectory>C:\CruiseControl\My-Project-Nightly\Third Party Libraries</workingDirectory> 
      <workspace>Brand-Nightly</workspace> 
     </vsts> 
     </sourceControls> 
    </sourcecontrol> 
    <labeller type="defaultlabeller"> 
     <prefix>Brand-</prefix> 
    </labeller> 
    <triggers> 
     <scheduleTrigger time="02:15" buildCondition="ForceBuild" name="BrandNightlyBuild"> 
     </scheduleTrigger> 
    </triggers> 
    <tasks> 
     <msbuild> 
     <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable> 
     <projectFile>C:\CruiseControl\My-Project-Nightly\Brand Web\Main\Build\Nightly.build</projectFile> 
     <buildArgs>/p:Configuration=Debug /p:Platform=x86 /p:TargetFramework=4.0 /p:OutputPath=C:\CruiseControl\My-Project-Nightly\output\</buildArgs> 
     <timeout >360000</timeout> 
     </msbuild> 
    </tasks> 
    </project> 
</cruisecontrol> 
+0

您可以发布CI配置文件? –

+0

我已经更新了部分CCNET.config文件的问题(我们有很多项目) –

+0

您可以发布** Nightly.build **。我想在这个文件中你正在发布代码 –

回答

1

我们这样做了。我们创建了两个配置文件。

1配置文件

<msbuild> 
     <executable> 
     C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe 
     </executable> 
     <workingDirectory> 
     Project dorecotry 
     </workingDirectory> 
     <projectFile> 
     Path to second config file 
     </projectFile> 
     <timeout>600</timeout> 
     <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger> 
    </msbuild> 

第二个配置文件将发布的代码。

第二个配置文件

<Project 
     xmlns = "http://schemas.microsoft.com/developer/msbuild/2003" 
     name = "AspNetPreCompile" 
     DefaultTargets = "PrecompileWeb"> 
     <Target Name = "PrecompileWeb"> 
       <AspNetCompiler 
         VirtualPath = "DeployTemp" 
         PhysicalPath = "Path of project file" 
         TargetPath = "Path of published code" 
         Force = "true" 
         Debug = "true" 
         Updateable = "true"/> 
     </Target> 
</Project> 

请检查blog

+0

为什么你需要两个CruiseControl配置?我昨天也试过了AspNetCompiler MSBUILD任务,并且因为它没有在CI服务器上设置,所以我得到了关于IIS未正确设置的错误。 –

+0

实际上,在第一个配置文件中,我们正在做很多事情,比如拉取最新的代码。构建它,然后执行源监视器,Web配置编辑等的一些文件,因此我们将项目分离为其他配置文件 –

+0

尝试** AspNetPrecompile **以上设置。正确给出物理路径。 –

相关问题