
Castle comes with a handy batch script called Release.bat. I guess in theory the idea is to simply run that and away you go. However running the script as it is produced the following error:
[csc] Compiling 173 files to 'C:\Development\Tools\OSS\Castle-Trunk\build\net-2.0\release\Castle.MicroKernel.dll'.
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Context\CreationContext.cs(99,12): error CS0246: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Context\CreationContext.cs(101,5): error CS1502: The best overloaded method match for 'System.Collections.Generic.Stack<Castle.MicroKernel.IHandler>.Push(Castle.MicroKernel.IHandler)' has some invalid arguments
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Context\CreationContext.cs(101,28): error CS1503: Argument '1': cannot convert from 'var' to 'Castle.MicroKernel.IHandler'
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Context\CreationContext.cs(221,4): error CS0246: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Context\CreationContext.cs(225,5): error CS1502: The best overloaded method match for 'System.Collections.Generic.Stack<Castle.MicroKernel.CreationContext.ResolutionContext>.Push(Castle.MicroKernel.CreationContext.ResolutionContext)' has some invalid arguments
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Context\CreationContext.cs(225,26): error CS1503: Argument '1': cannot convert from 'var' to 'Castle.MicroKernel.CreationContext.ResolutionContext'
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Context\CreationContext.cs(227,11): error CS0029: Cannot implicitly convert type 'var' to 'Castle.MicroKernel.CreationContext.ResolutionContext'
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Handlers\DefaultHandler.cs(48,10): error CS0246: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)
[csc] c:\Development\Tools\OSS\Castle-Trunk\InversionOfControl\Castle.MicroKernel\Releasers\AllComponentsReleasePolicy.cs(63,17): error CS0246: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)
And a quick peek at the release.bat file reveals the problem:
@echo off
nant -t:net-1.1 -f:release.build package-net-1.1 %*
nant -t:net-2.0 -f:release.build package-net-2.0 %*
So, going with that, the soluton should be:
nant -t:net-3.5 -f:release.build package-net-3.5 %*
Yeah? Unfortunately not, the release.build doesn't contain a Target called package-net-3.5. So a quick copy and paste later:
<target name="package-net-3.5">
<!--
clean is first target executed so we can get rid of
any old assemblies
-->
<nant buildfile="default.build" target="clean build installer">
<properties>
<property name="build.rebuild" value="true" />
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="project.config" value="release" />
<property name="sign" value="true" />
<property name="build-zipfile" value="${build.dir}/Castle-${project.major}.${project.minor}.${project.build}-${framework::get-target-framework()}-${project.config}-${datetime::get-year(datetime::now())}-${datetime::get-month(datetime::now())}-${datetime::get-day(datetime::now())} (r${svn.revision}).zip" dynamic="true" />
</properties>
</nant>
</target>
Run the command, sit back and wait for your shiney new assemblies. Success!
NHibernate
I use Castle's NHibernate facilities and did plan on rebuilding Castle with the latest version of NHibernate. Unfortunately the way NHibernate deals with proxies for lazy loading is changing and Castle hasn't ben updated yet. This is something I'm going to look at this week as I would like to use the latest NHibernate. And yes, the Core NHibernate assembly no longer has a dependency on Castle!