I couldn't find any questions around this already but it may just be me and my lame searching skills, but basically I've got 2 different solutions sharing some projects.
The projects in solution 1 I've just upgraded their version of ElasticSearch's NEST to 6.1;
<Reference Include="Nest, Version=6.0.0.0, Culture=neutral, PublicKeyToken=96c599bbe3e70f5d, processorArchitecture=MSIL">
<HintPath>..\packages\NEST.6.1.0\lib\net46\Nest.dll</HintPath>
</Reference>
One of these projects is also used in my 2nd solution but other projects in this solution are still on v5.5 as I haven't touched them yet;
<Reference Include="Nest, Version=5.0.0.0, Culture=neutral, PublicKeyToken=96c599bbe3e70f5d, processorArchitecture=MSIL">
<HintPath>..\packages\NEST.5.5.0\lib\net46\Nest.dll</HintPath>
<Private>True</Private>
</Reference>
When building, testing or deploying (using TeamCity) no errors appear at all, making it seem all good, but once this is deployed and we try and use a project which references 5.5 which has a reference to another project which using 6.1, we understandably get this error;
Could not load file or assembly 'Nest, Version=5.0.0.0, Culture=neutral, PublicKeyToken=' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Now, I'm pretty sure I just need to update all projects to the same version to fix this but I'm looking how to prevent these types of issues in the future.
How can issues like this be prevented before getting to the deployed part of this process? Why isn't this issue detected earlier during builds/tests that cover the same functionality that fails once deployed?!
User contributions licensed under CC BY-SA 3.0