Using CciSharp in the Build
integrates in the build through custom MSBuild targets. The targets call into the
command line tool at the right place in the build process to rewrite the assemblies produce by the C# or VisualBasic.NET compiler.
Download and place CciSharp
Download the latest binaries from CciSharp. CciSharp is xcopy-deployable, simply drop them in a place that will be convinient to use from your build. Usually, you will want to check those binaries in your source control as well.
Editing your projects
- Open the project file (.csproj or .vbproj) using a text editor - or - unload the project, then click on the 'Edit Project File'.
- Modify the project file as follows:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- begin CciSharp -->
<Import Project="CciSharp.targets" />
<!-- end CciSharp -->
- In the main configuration or separate configuration, enable CciSharp by setting the
CcsRewriting property to
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Selecting the mutators
The msbuild tasks will look for assemblies containing mutators in default location. By convention, such assemblies must be named
- any assembly in the path of ccs.exe that matches the naming pattern,
- any assembly in a sub-folder CciSharp from the solution directory,
- any assembly in a sub-folder CciSharp from the project directory.
If this behavior is not enough, one can provide the location of mutator assemblies by including them into the
<CcsMutatorAssemblies Include=" path to your mutators " />