This project is read-only.

Using White from NuGet

Aug 7, 2012 at 6:05 PM

Hi I am trying to use White from NuGet.

I have added package White 0.2.0 from the NuGet package manager.  It all got installed and added to my project OK, along with all it's dependencies - Bricks, Castle, log4net etc.

All build fine.

However, at runtime I get an assembly load exception:

Could not load file or assembly 'log4net, Version=, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. 

Looking at the version of log4net referenced by the White.Core assembly, it's version as is appearing in that error above.

However it has loaded log4net v1.2.11.0 into my project.

I tried a simple assembly binding redirect to try and get it to load when an older version was requested:

        <assemblyIdentity name="log4net" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="" />

However this didn't work.

On closer inspection it seems that log4net has a DIFFERENT public key that!

Has anyone come across this problem?

Any ideas on a nice way to solve it?

Anyone successfully using White via NuGet???


Aug 8, 2012 at 10:46 AM

So I think I got around the problem by forcing the older version of log4net to be used instead of

Here is my full workaround in case anyone runs into the same issue:

1. Add White via NuGet package manager as usual
2. Go into packages.config and change the log4net version from 2.0.0 to 1.2.10
3. Rebuild the project (which should load the older log4net package)
4. Unload the project and edit the project file
5. Locate the hint path for the log4net reference and change it from ..\packages\log4net.2.0.0\lib\net40-full\log4net.dll to ..\packages\log4net.1.2.10\lib\2.0\log4net.dll
6. Reload the project
7. Save All
8. Close the solution
9. Open the solution
10. Clear All
11. Rebuild All
12. Done!