I'm having some issues with MSBUILD being used on the command line vs. CruiseControl.NET as the results are different and I cannot see why that would be.
While invoking MSBUILD On the commandline on my local machine the project gets built and the output directory contains a bunch of DLLs and PDB files and a sub directory called _PublishedWebsites which contains the two web applications in my solution (a ASP.NET MVC application and a WCF web service).
So far so good.
On the CI server, this folder is not being created.
It is the same msbuild project file that is being used for both so I cannot see what the difference could possibly be. After some hours of Googling I'm now at a complete loss.
I'm assuming that there is something in the environment on my local machine that sets a default somewhere that is not present on the CI server.
Is there any specific option I have to set somewhere to explicity tell MSBUILD to create a folder contains the published web applications?
UPDATE The CCNET.config (partial)
<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>开发者_StackOverflowfalse</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>
We done it in this way. We created two config files.
1st config file
<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>
The second config file will publish the code.
2nd config file
<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>
please check the blog
精彩评论