Castle Windsor/Core 2.5.2

New Windsor logo

Today we released second bugfix release for Windsor 2.5 and for Core 2.5 (incl. DynamicProxy, which is what probably is the most interesting to people). This time there are no new features, only fixes to issues identified since the last release (you can see the entire list in changes.txt). We have however updated to NLog 2, and since it works in Silverlight, this release also has Logging Facility for Silverlight. This is very likely the last release in 2.5 branch, and all development now moves to vNext.

One thing you may notice, is that while file number was bumped to 2.5.2, assembly version still shows 2.5.1. This was requested by several users who didn’t want to have to recompile all third party dependencies using Windsor 2.5.1 again, in order to use the new version.

If you’re in such situation, you may drop and replace older assemblies with the new ones, and in 99% of cases you should be just fine. However in order to fix some issues, there were few breaking changes, so if the other projects you’re using were depending on the changed code you will have to upgrade them to version compatible with Windsor 2.5.2 anyway.

New logo

One more noteworthy development in Castle land, as you may have noticed if you visited Castle Project website recently is that we have a new logo (or rather – set of logos) created by my very talented wife.

Now back to me – the downloads are here (Windsor and Core) and here (just Core) – enjoy. I am on a horse.

Comments

Per Lundberg says:

The page http://castleproject.org/castle/download.html still seems to show only 2.5.1 info. Just FYI. 🙂

happy says:

study

Sunghyouk Bae says:

At first, Thanks for Castle Core/Windsor

I want differently set version

AssemblyVersion : 2.5.1.0
AssemblyInformaction : 2.5.1.0
AssemblyFileVersion : 2.5.2.0

like me…

[assembly: AssemblyVersionAttribute("4.0.0.0")]
[assembly: AssemblyInformationalVersionAttribute("4.0.0.0")]
[assembly: AssemblyFileVersionAttribute("4.0.0.1004")]

if you view property assembly in Explorer, you see FileVersion and InformationalVersion…

Thanks for your efforts

Scooletz says:

Seems that your wife touched all of the Castle projects. Soft and coherent the logos are:)

Ivan says:

having some trouble with 2.5.2:
Cleaning up with container.Dispose()
_sometime_ throws exeception at this windsor code:
Castle.Windsor\MicroKernel\Releasers\AllComponentsReleasePolicy.cs

public bool HasTrack(object instance)
{if (instance == null) throw new ArgumentNullException(“instance”);

Value cannot be null.
Parameter name: instance

It never happens with 2.5.1

Krzysztof says:

Can you post a reproduction of the issue?

Ivan says:

//simple console app.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Castle.Windsor;
using Castle.Facilities.TypedFactory;
using Castle.MicroKernel.Registration;

namespace ConsoleApplication1
{

public interface IProducedComponent : IDisposable
{}

public class ProducedComponent : IProducedComponent
{
List _datasets = new List();
public ProducedComponent()
{
// something big in the memory
for ( int i = 0 ; i < 1000000 ; i++ )
{
_datasets.Add( new DataSet() );
}
}

public void Dispose()
{}
}

public interface IProducedComponentFactory
{
IProducedComponent CreateProducedComponent();
void Destroy( IProducedComponent producedComponent );
}

public interface IService : IDisposable
{
IProducedComponentFactory ProducedComponentFactory { get; set; }
void MakeAndDestroyComponent();
}

public class Service : IService
{
public IProducedComponentFactory ProducedComponentFactory { get; set; }
public void MakeAndDestroyComponent()
{
IProducedComponent component = ProducedComponentFactory.CreateProducedComponent();
ProducedComponentFactory.Destroy( component );
}
public void Dispose()
{}
}

class Program
{
static void Main( string[] args )
{

var container = new WindsorContainer();
container.AddFacility();
container.Register( Component.For().ImplementedBy().LifeStyle.Transient );
container.Register( Component.For().AsFactory() );
container.Register( Component.For().ImplementedBy().LifeStyle.Singleton );
IService service = container.Resolve();
for ( int i = 0 ; i < 4 ; i++ )
{
service.MakeAndDestroyComponent();
}
container.Dispose(); // here throws an exception "Value cannot be null"

}
}
}

Ivan says:

It seems, that lessthen and greatethen was cut.
I’ve replaced them with &lt and >

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Castle.Windsor;
using Castle.Facilities.TypedFactory;
using Castle.MicroKernel.Registration;

namespace ConsoleApplication1
{

public interface IProducedComponent : IDisposable
{}

public class ProducedComponent : IProducedComponent
{
List<DataSet> _datasets = new List<DataSet>();
public ProducedComponent()
{
// something big in the memory
for ( int i = 0 ; i < 1000000 ; i++ )
{
_datasets.Add( new DataSet() );
}
}

public void Dispose()
{}
}

public interface IProducedComponentFactory
{
IProducedComponent CreateProducedComponent();
void Destroy( IProducedComponent producedComponent );
}

public interface IService : IDisposable
{
IProducedComponentFactory ProducedComponentFactory { get; set; }
void MakeAndDestroyComponent();
}

public class Service : IService
{
public IProducedComponentFactory ProducedComponentFactory { get; set; }
public void MakeAndDestroyComponent()
{
IProducedComponent component = ProducedComponentFactory.CreateProducedComponent();
ProducedComponentFactory.Destroy( component );
}
public void Dispose()
{}
}

class Program
{
static void Main( string[] args )
{

var container = new WindsorContainer();
container.AddFacility<TypedFactoryFacility>();
container.Register( Component.For<IProducedComponent>().ImplementedBy<ProducedComponent>().LifeStyle.Transient );
container.Register( Component.For<IProducedComponentFactory>().AsFactory() );
container.Register( Component.For<IService>().ImplementedBy<Service>().LifeStyle.Singleton );
IService service = container.Resolve<IService>();
for ( int i = 0 ; i < 4 ; i++ )
{
service.MakeAndDestroyComponent();
}
container.Dispose(); // here throws an exception Value cannot be null.

}
}
}

Krzysztof says:

Right, looks like a bug in the facility.
Please submit a bug report to the issue tracker.

Thanks,

Krzysztof

Krzysztof says:

BTW, that’s fixed in the trunk already.

Ivan says:

Now everything is fine! Thank you!