NUnit assembly version redirection issues (what is [AssemblyName] .temp.config?)

I use some of the test libraries from Sharp Architecture that use NUnit 2.5.0, while the rest of my project uses NUnit 2.5.1, so I put the reconfiguration of the assembly in the configuration file of the test project application:

<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <assemblyBinding> <dependentAssembly> <assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" /> <bindingRedirect oldVersion="2.5.0.9122" newVersion="2.5.1.9189"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> 

I still get the assembly redirect version:

 TestCase '' failed: Could not load file or assembly 'nunit.framework, Version=2.5.0.9122, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) System.IO.FileLoadException: Could not load file or assembly 'nunit.framework, Version=2.5.0.9122, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'nunit.framework, Version=2.5.0.9122, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' 

Enabling my Fusion ErrorLog I can see this:

 === Pre-bind state information === LOG: DisplayName = nunit.framework, Version=2.5.0.9122, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77 (Fully-specified) LOG: Appbase = file:///C:/code/Samples/PersistencePatterns/app/PersistencePatterns.Tests/bin/Debug LOG: Initial PrivatePath = NULL Calling assembly : SharpArch.Testing.NUnit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b5f559ae0ac4e006. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\code\Samples\PersistencePatterns\app\PersistencePatterns.Tests\bin\Debug\PersistencePatterns.Tests.dll.temp.config LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Post-policy reference: nunit.framework, Version=2.5.0.9122, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77 LOG: Attempting download of new URL file:///C:/code/Samples/PersistencePatterns/app/PersistencePatterns.Tests/bin/Debug/nunit.framework.DLL. WRN: Comparing the assembly name resulted in the mismatch: Revision Number ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. 

What gives? What is the temp.config file it is looking for? Why doesn't he look into my actual configuration?

Well, no matter, I added the following events after the build:

 copy $(ProjectDir)App.config $(TargetDir)\$(TargetFileName).temp.config 

Everything is copied perfectly, but as soon as I run the tests with Testdriven.NET, the file disappears.

Can someone give me a hint about what's going on?

+4
source share
1 answer

Have you tried to copy the class library App.config file without the ".temp" part?

 copy $(ProjectDir)App.config $(TargetDir)\$(TargetFileName).config 

EDIT: "* .temp.config" is apparently generated by TestDriven.NET, as [stated in the release notes of version 2.3][1]

+1
source

All Articles