Resolving Dependent .NET Assembly Version Conflicts

I ran into an interesting error message this morning while adding some NUnitAsp unit tests to Bloget.

------ Build started: Project: Bloget, Configuration: Debug Any CPU ------  
Bloget -> D:\Data\Visual Studio 2005\Projects\Bloget\Bloget\bin\Debug\Bloget.dll  
------ Build started: Project: D:\...\BlogetTest\, Configuration: Debug .NET ------  
Validating Web Site  
Validation Complete  
------ Build started: Project: UnitTests, Configuration: Debug Any CPU ------  
**Consider app.config remapping of assembly "nunit.framework, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" from Version "" [] to Version "" [C:\Program Files\TestDriven.NET 2.0\NUnit\nunit.framework.dll] to solve conflict and get rid of warning.  
**C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3247: **Found conflicts between different versions of the same dependent assembly**.  

I’ve highlighted the relevant bits here. This occurs because NUnitAsp depends on a different version of the NUnit framework than Test Driven .NET. I’m a bit fan of TDN but I also want to unit test the UI portions of Bloget which is what NUnitAsp does (more on this in another blog post). Fortunately, the error message gives you all you need to know to fix the problem. I added an App.config file to the project with the following XML.

<?xml version="1.0"?>  
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
<assemblyIdentity name="nunit.framework" publicKeyToken="96D09A1EB7F44A77" culture="neutral"/>  
<bindingRedirect oldVersion="" newVersion=""/>  

Once added, the build and run work as expected.

← newer older →
.Net, Technology, Life, Whatever

Recent Posts

Fixed Focal-Length Eyeglasses, a Programmer's Best Friend
How to Choose the Right VPN Service
Two Handy Command Line Scripts
Tweetz 1.3.2
Tweetz 1.3 Release
Mithril Rising
Tweetz Release 1.2.4 - Screen Off Detection
More... (1085)