castle

Quickly Building Castle with .NET 3.5

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...

posted @ Tuesday, November 11, 2008 2:23 PM | Feedback (0)

Blisteringly fast Integration Tests with NHibernate and SQLite

One thing I love about using NHibernate as my O/RM is being able to push the database schema from the domain.  This lets me create the database from scratch for each integration test fixture and get it into the required state.  Creating the database with NHibernate is quick and simple.  Hell, here is the code to do it: Configuration cfg = container.Resolve<Configuration>(); SchemaExport export = new SchemaExport(cfg); export.Execute(true, true, false, true); Nifty, eh? But tests that hit the database are sloooow, and these quickly become tests that are not ran. Tests that query the database are slow, and because I regenerate the whole database...

posted @ Friday, October 10, 2008 11:29 AM | Feedback (4)

Using Spark with ASP.NET MVC and Binsor

I use Binsor for configuring Castle and Spark as my default ViewEngine for ASP.NET MVC.  This is how I register and resolve the ViewEngine container.boo component "Spark.Web.Mvc.SparkViewFactory", IViewEngine, SparkViewFactory component "Spark.FileSystem.FileSystemViewFolder", IViewFolder, FileSystemViewFolder global.asax container.Install(BinsorScript.FromFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "container.boo"))); ViewEngines.Engines.Add(container.Resolve<IViewEngine>());

posted @ Wednesday, October 01, 2008 12:59 PM | Feedback (0)