Intellisense for CruiseControl.Net configuration files

Editing the CruiseControl .Net configuration file ccnet.config may be a cumbersome process. The XML configuration elements are documented at http://ccnetlive.thoughtworks.com/ccnet/doc/CCNET/Configuring%20the%20Server.html, but it would be more convenient to have intellisense available when editing the configuration file.

Intellisense for CCNet configuration files can be added to Visual Studio by using the schema definition file ccnet.xsd. Unfortunately this file is not distributed by the CCNet installation package, but it is included in the source distribution. For the current version the file is located at “\project\ccnet.xsd” in the downloadable source distribution zip file.

Your can also get it from the the source code repository at SourceForge (link is to version 1.5).

Adding the XSD schema to Visual Studio

Once you have gotten your hands on the ccned.xsd file, it must be copied to the schema folder of your Visual Studio installation, e.g. to  “C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas\”.

Note: Copying the file to the folder “Microsoft Visual Studio 10.0\Common7\Packages\schemas\xml” will not have any effect!

Configuring the namespace

Which namespace should be used for the CCNet configuration files? A namespace must be specified in order for Visual Studio to know which schema to use for intellisense.

CCnet.xsd defines the target namespace "http://thoughtworks.org/ccnet/1/5":

<?xml version="1.0" encoding="utf-8"?>
<
xs:schema targetNamespace="http://thoughtworks.org/ccnet/1/5"
    elementFormDefault="qualified"
    xmlns="http://thoughtworks.org/ccnet/1/5"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <
xs:element name="cruisecontrol">

… which means that the following namespace must be defined in the CCNet configuration files:

<cruisecontrol xmlns="http://thoughtworks.org/ccnet/1/5">
  <
project name="foo">
    <
webURL>http://localhost/ccnet</webURL>
    <
modificationDelaySeconds>10</modificationDelaySeconds>

The schema file seems to favor using XML elements instead of attributes for many configuration options, which contradicts many of the example configurations which are distributed with CCNet, but I don’t consider this as being a big issue.

Etiketter: