Search code examples
c#.netmsbuildcruisecontrol.netpublish

Using CruiseControl.NET and MSBuild to publish a website


I am trying to set up CruiseControl.NET to automatically download a new version from SVN (VisualSVN_Server) and publish it to the beta directory.

THis is the CruiseControl.NET configuration file concerning MSBuild:

<msbuild>
    <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
    <workingDirectory>C:\CI\WORKING</workingDirectory>
    <projectFile>WashMyCarHomepage\WashMyCarHomepage.csproj</projectFile>
    <buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag /p:WebProjectOutputDir=C:\inetpub\wwwroot.beta</buildArgs>
    <targets>Build;Test</targets>
    <timeout>900</timeout>
    <logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
  </msbuild>

CruiseControl.NET runs MSBuild successfully, but MSBuild fails with:

standard-error stream closed -- null received in event
standard-output stream closed -- null received in event
process exited event received

I was also trying to run MSBuild manually from a console to try whether it works alone. But I was unable to get a proper output (publishable to the web). I tried:

C:\Windows\Microsoft.NET\Framework\v4.0.30319>MSBuild.exe C:\CI\WORKING\WashMyCarHomepage\WashMyCarHomepage.csproj /property:OutDir=C:/CI/TEST;Configuration=Release /t:Publish

But the project was skipped by "skipping unpublishable project".

I have a following structure of the solution:

WashMyCarHomepage\WashMyCarHomepage.sln
WashMyCarHomepage\Repository\Repository.csproj
WashMyCarHomepage\WashMyCarHomepage\WashMyCarHomepage.csproj

How can I fix this problem?


Solution

  • After a long struggle with this issue I did find a solution. I am providing the whole CruiseControl.NET configuration file.

    <cruisecontrol xmlns:cb="urn:ccnet.config.builder">
      <project name="Aucis">
        <workingDirectory>C:\CI\WORKING</workingDirectory>
        <artifactDirectory>C:\CI\BUILD</artifactDirectory>
        <triggers>
          <intervalTrigger name="CI Trigger" seconds="120" buildCondition="IfModificationExists"/>
        </triggers>
        <tasks Name="Clean">
          <msbuild>
            <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
            <workingDirectory>C:\CI\WORKING</workingDirectory>
            <projectFile>WashMyCarHomepage\WashMyCarHomepage.csproj</projectFile>
            <buildArgs>/p:OutputPath=bin /P:Configuration=Deploy-Dev /P:DeployOnBuild=True /P:DeployTarget=MSDeployPublish /P:MsDeployServiceUrl=localhost /P:AllowUntrustedCertificate=True /P:MSDeployPublishMethod=WMSvc /P:CreatePackageOnPublish=True /P:UserName=WindowsUsername/P:Password=WindowsPassword</buildArgs>
            <timeout>900</timeout>
            <logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
          </msbuild>
        </tasks>
        <sourcecontrol type="svn">
          <executable>C:\Program Files (x86)\VisualSVN Server\bin\svn.exe</executable>
          <trunkUrl>https://localhost:8443/svn/project/trunk</trunkUrl>
          <username>svn_username</username>
          <password>svn_password</password>
          <autoGetSource>true</autoGetSource>
          <cleanCopy>true</cleanCopy>
          <revisionNumbers>true</revisionNumbers>
          <tagBaseUrl>https://localhost:8443/svn/project/tags</tagBaseUrl>
        </sourcecontrol>
      </project>
    </cruisecontrol>
    

    Please note that "Deploy-Dev" is a configuration that is set in a VisualStudio.