I am using a nUnit to, well, unit test an assembly.
The assembly is in my project output dir (\bin\debug) and is loaded into nUnit (Assemblies > Add Assembly) from this location.
However an older version is also in the GAC and nUnit is picking this one up instead.
I can of course remove the old version and re-install to the GAC upon build but this takes some time - any way to force nUnit (or more likely the .NET framework) to pick up the version from the bin\debug dir?
EDIT
The AssemblyVersion (and hence strong name) of both versions are fixed - its only the file version that changes as per KB 556041 - How to use Assembly Version and Assembly File Version
You could try to make a <bindingRedirect>
in your .config file to redirect to your local assembly and to not use the one installed in the GAC.
When you build a .NET Framework application against a strong-named assembly, the application uses that version of the assembly at run time by default, even if a new version is available. However, you can configure the application to run against a newer version of the assembly
...
<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="myAssembly" publicKeyToken="32ab4ba45e0a69a1" culture="neutral" /> <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
This might also be interesting for you:
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With