CruiseControl.Net Failed Build - No explanation - cruisecontrol.net

I am just beginning to set up a Continuous Integration Server using CruiseControl.Net. To keep things simple to begin with, I used the Visual Studio Task to carry out the build, pointing it at the project solution file. However, when the build process occurs, CC.Net successfully gets the latest source version from Subversion, and appears to run the devenv command. The build process then fails, but there is no explanation about why. Here is the output:
BUILD FAILED
Project: MyProject
Date of build: 2009-09-09 16:31:13
Running time: 00:00:49
Integration Request: Dashboard triggered a build (ForceBuild)
Modifications since last build (0)
Tests run: 0, Failures: 0, Not run: 0,
Time: 0 seconds No Tests Run This
project doesn't have any tests
There is nothing else displayed on the page. My XML Logs don't show any build results either.
This is my configuration file:
<!--<ccnetconfig><configurationVersion>1.4</configurationVersion></ccnetconfig>-->
<cruisecontrol>
<project name="MyProject">
<workingDirectory>C:\Users\Builder\Desktop\builder-pc\MyProject</workingDirectory>
<sourcecontrol type="svn">
<trunkUrl>svn://builder-pc/MyProject/trunk</trunkUrl>
<workingDirectory>C:\Users\Builder\Desktop\builder-pc\MyProject</workingDirectory>
<executable>C:\Program Files\Subversion\bin\svn.exe</executable>
<autoGetSource>True</autoGetSource>
<tagOnSuccess>True</tagOnSuccess>
</sourcecontrol>
<tasks>
<devenv>
<solutionfile>C:\Users\Builder\Desktop\builder-pc\MyProject\trunk\MyProject.sln</solutionfile>
<configuration>release</configuration>
<buildtype>Rebuild</buildtype>
<executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe</executable>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
</devenv>
</tasks>
</project>
</cruisecontrol>
I have deliberately removed things like the SVN username and password.
Building the solution using the VS Command Prompt works, albeit with warnings. This is using the same swtiches that CC.Net would be using.
Can anyone help? Is it failing because there are no unit tests to run, or because of the warnings? Or is it best to switch to MSBuild or NAnt instead of using the Visual Studio Task?

If there is no useful information in the build log, try looking at the server log for information about the failure.

I think the reason you aren't seeing any output in the xml log files is because you don't have an appropriate <publishers> section in your <project>.
Try:
<publishers>
<xmllogger />
</publishers>

Try running the build with MSBuild instead of devenv.exe. If the log gets merged into the xml but is not displayed properly in the web dashboard, make sure that appropriate xsl transforms are enabled. Also, as Scrappydog mentioned, add the xmllogger publisher (although it should be added by default if you don't have any publishers defined at all, you can check this in the 'Project Configuration' page on the dashboard.

You should use devnev.com (note the file extension is .com, not .exe) in the same path (i.e. C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE), instead of devnev.exe.
The <executable> block is optional, and from the CruiseControl.NET documentation, it will use the latest version of devnev.com, not devnev.exe.

Related

Azure Build Pipeline: VSBuild fails on The CodeDom provider

My build pipeline (Microsoft-hosted agent) has been running every morning for a couple of months but this morning it suddenly failed on the VSBuild task. The error is described as:
"##[error]ASPNETCOMPILER(0,0): Error ASPCONFIG: The CodeDom provider type "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" could not be located."
See image of failed build here
How do i fix this?
Not sure if you use private agent. As I know this error could result from the fact that PrecompileBeforePublish property is set to true somewhere in your project.(csproj or publish profile).
As one workaround you can pass /p:PrecompileBeforePublish=false as argument to your VSBuild Task. But this may make first response of your application slow.
Or you can register it into GAC using command like this:
gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\xxxx\VSEditon\Common7\IDE\PublicAssemblies\CppCodeProvider.dll"
Cause after VS2017, the C++ project support for xsd.exe is deprecated, we need to manually add its assembly into GAC as described here.
I managed to solve this by just skipping build on the assets project that failed. This was done using the Configuration Manager in Visual Studio (found in Build->Configuration Manager). I just removed the check mark. See attached images for clarification.
Skip project build
Configuration Manager

Unrecognized configuration section publishers in CCNet.config when adding slackPublisher integration

The Slack integration for CCNet is neat https://github.com/jrjackso/CCNetSlackPublisher but I get this error when adding the to the ccnet.exe.config file:
"Unrecognized configuration section publishers. (C:\Program Files (x86)\CruiseControl.NET\server\ccnet.exe.Config line 167)"
I'm running CCnet version 1.8.5.0 (that's the File Version on ccnet.exe at least). I tried copying the dlls from that version into the CCNetSlackPublisher solution before I built it but that didn't change anything.
Does the <publishers> section need to be inside anything besides just the tag? I just put it at the bottom of the file, between </runtime> and </configuration>.

VS2012 MSBuild: Publish a Web Application Project with Existing Publish Profile

In the Visual Studio 2012 Build menu, there's a Publish command. In this you can establish profiles which are saved as .pubxml files in the Properties folder of the Project. I have one such profile that's a simple file copy operation - it just compiles the site and dumps it to a folder.
How can I use msbuild at the command line to publish a compiled web application to a folder?
What I've tried
I've tried the example from this question:
After Publish event in Visual Studio
And the changes and examples given here:
http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild
The latter seems to get closest, but it causes every library Project the .csproj I'm attempting to publish from to throw an error:
Project "MainProj.csproj" (1) is building "ReferencedProj.csproj" (2) on node 1 (default targets).
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(609,5): error : The OutputPath property is not set for project 'ReferencedProj.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Staging' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [ReferencedProj.csproj]
Done Building Project "ReferencedProj.csproj" (default targets) -- FAILED.
This approach is very similar to what's suggested in this answer:
https://stackoverflow.com/a/7077178/176877
The crucial difference may be that I'm in Visual Studio 2012, rather than VS2008 or 2010.
Old question, but in case this helps anyone, this simple, stripped back approach worked fine for me:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
...
<BuildDependsOn>
$(BuildDependsOn);
PublishOtherProject;
</BuildDependsOn>
</PropertyGroup>
<Target Name="PublishOtherProject">
<MSBuild Projects="pathtomyproject.csproj" Properties="DeployOnBuild=true;PublishProfile=nameOfPublishProfile" />
</Target>
The key line being:
<MSBuild Projects="pathtomyproject.csproj" Properties="DeployOnBuild=true;PublishProfile=nameOfPublishProfile" />

Can Visual Studio 2012 do a custom build such as: compile project A > compile and link project B > link project A?

I am looking for a way to builds projects in this order with Visual Studio 2012 (C++ but might be a general question):
Compile ProjectA (I just need the .objs)
Compile and link ProjectB
Link ProjectA
I can't simply use a reference/dependency of ProjectA in ProjectB because it will perform the link of ProjectA too early.
I used to do this with VS 2008 this way:
PreBuild Event on ProjectB: vcbuild /pass0 /pass1 ProjectA
Compile and link ProjectB (which is a dependency of ProjectA)
Compile (actually does nothing as it was already built) and link ProjectA
But vcbuild is gone from VS 2012 and I replaced the command with:
msbuild /t:BuildGenerateSources /t:BuildCompile
The problem here is that at the 3rd step where it's supposed to only link (since msbuild already compiled) it now compiles again ProjectA and then links it. Enabling diagnostic verbosity with msbuild showed me this: Forcing rebuild of all source files due to a change in the command line since the last build.. And pretty much no one (including Visual Studio 2010 randomly says the command line changed, and rebuilds) has a solution for this as it's impossible to see what 2 commands are being compared.
The other benefit of doing what I'm looking for directly with Visual Studio (without a prebuild event that launches msbuild in a command line), would be to have compile errors reported to the Errors list and clickable in the Output window.
Maybe under the hood this would use msbuild and Targets specified in vcxprojs but I'd like to know if it's doable at all.
Edit: I have already tried to replace the command calling msbuild by devenv but there is no switch for devenv that can specify compile only (no linking), so it can't be used either.
Edit2: Sound like someone already asked something similar here (no solution) Is it possible for Visual Studio C++ to compile objects without linking
Ok so it can be done by overriding BuildSteps in the .vcxproj and removing the target BuildLink.
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<BuildSteps Condition="'$(BuildSteps)' == '' or '$(SkipLink)'!='false'">
ResolveReferences;
PrepareForBuild;
InitializeBuildStatus;
BuildGenerateSources;
BuildCompile;
<!-- BuildLink; -->
</BuildSteps>
</PropertyGroup>
When VS builds it will not perform the link step.
The original BuildSteps are defined in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.BuildSteps.target
To finally link the project on the command line later (from a build event on another project for example) we call:
msbuild /t:BuildLink /p:VisualStudioVersion=11.0 /p:Configuration=Debug /p:Platform=x64 /p:SkipLink=false "ProjectA.vcxproj"
Notice that a condition SkipLink has been added to the BuildSteps override so we can specify when to perform the BuildLink and when not to.

CruiseControl.NET: Ignore DB projects in a build

After upgrading to VS2010 we have a few .dbproj files that are causing issues in our CI builds. They do nothing except just store SQL files anyway, so I'd like to just ignore them. I'm running CruiseControl.NET and building my solution with devenv.com. Is there some way for me to tell the build that I want to ignore these projects, or all .dbproj projects?
One way to do it is to create a new solution configuration in Visual Studio. Go to the Debug menu and then Configuration Manager. Create a new configuration and then exclude your .dbproj projects.
Then use that configuration name in the command line of devenv.com instead of 'Debug' or 'Release'
Since its a just a files container project, you could just exclude it from build in Debug and Release
Use msbuild instead of devenv and it will support the 'excluded from build' feature (i think devenv doesn't)
An (somewhat) alternative would be to switch the project into a class library (which will actually will build nothing...)
An example MSBUILD task would be:
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>project_solution_path</workingDirectory>
<projectFile>project_solution_file</projectFile>
<buildArgs>/p:Configuration=Debug /p:VCBuildAdditionalOptions="/useenv" /v:diag /t:rebuild</buildArgs>
<timeout>300</timeout>
</msbuild>
HTH

Resources