For me, getting .NET 4.0 and Cruise Control .NET going came down to this:
1) Avoid 64 bit MSBuild like the plague... have a working 32 bit build first.
2) Just specify the fully qualified path to the logger, not the typical class,
assembly format.
3) Deploy the targeting pack from the VS 2010 disc. \WCU\MTPack\NetFx_DTP.msi EXTUI=1 /log install.log
4) Always prove MSBuild works from the command line first.
5) Create a configuration in your solution file and include only the projects you want to build
<msbuild>
<!-- WARNING: You must copy the files from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications to the same path on your build server -->
<executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>C:\builds\SOLUTIONFOLDER\trunk\</workingDirectory>
<projectFile>C:\builds\SOLUTIONFOLDER\trunk\SOLUTIONNAME.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=CruiseControl /v:diag</buildArgs>
<targets>Build</targets>
<timeout>15</timeout>
<logger>C:\CruiseControl\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
</msbuild>
Now if Microsoft would only let us easily install MSTest on our Build Servers... People have been begging for 5 years, how can Microsoft have learned so little about testing?
Good luck all.