Within a bigger Visual Studio solution (.NET Framework), one test project ignores the path of a third-party assembly reference (file path reference) and, instead, uses a different version of the same third-party assembly, which it finds in a sub-directory of the project. Removing and re-addding the reference does not change anything.
Solution/ project structure looks like this:
The reference on the test project always points to the old version of the third-party DLL.
The third-party DLL has a strong name, if relevant, but is not installed in the GAC.
The test file package cannot be changed as it is provided by an external customer.
I already added a binding redirect (third-party DLL is backwards compatible), but build fails with error "[...] uses higher version than referenced assembly [...]".
I guess, I am doing something wrong on adding the reference but I cannot figure it out...
Any help or idea is welcome!
Thanks to this detailed description of the assembly resolving, I identified that including the test files in the VisualStudio project was causing the errors. Despite setting the build action to "none", it seems that VisualStudio was considering the files for the probing path. After excluding the files from the project (but still under version control), the right version of the assembly is used.