Castle Windsor NLog Integration dll versioning problem

Today I was setting up a new project that was using Castle Windsor’s NLog integration facility. However, when I tried running my ASP.NET MVC project I got the following error:

Could not load file or assembly ‘NLog, Version=, Culture=neutral, PublicKeyToken=5120e14c03d0593c’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The solution was to add the following entry in the configuration file

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="" />

It is important to note the xml namespace. This workaround, I believe, is not specific to NLog or Castle. From my limited understanding, this is caused by the fact that I’ve got a newer version of NLog ( while Castle Windsor is expecting version

Posted in .NET, ALT.NET, Castle.Windsor, NLog, Troubleshooting

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: