I have the following setup:
Solution N1 -> .net 3.5, Ninject 2.2
Solution N2 -> .net 4.5.2, Ninject 3.2
I added a project from Solution N1 to Solution N2 and then generated fakes for the project that uses Ninject 2.2. In vs, the fakes generation succeeds. In MsBuild (and in TeamBuild) I get the following error:
C:\Somepath\Fakes\SomeProj.fakes: assembly C:\Somepath\SomeProj.dll failed to load properly Could not resolve assembly 'Ninject, Version=2.2.0.0, Culture=neutral, PublicKeyToken=6b7e450ec5ed63ad'. Are you missing an assembly reference?
So my tests are not working on build, even though I selected vs test runner (not msbuild) for running tests.
Unfortunately I can not update Ninject in Solution N1 for some external reasons. In production the app works as I have Ninject remapped to 3.2.0.0 and it works.
Any idea how to make fakes either load 3.2.0.0 (without referencing in SomeProj) or just ignore that code? (I tried specifying the stubs and shims that I need explicitly, same error in MsBuild).
So what I did in the end was add the old Ninject to the repo, and then referenced it like so inside .fakes
file:
<Compilation>
<Reference Path="RelativeToCsProjFolder\Ninject.dll" FullName="Ninject, Version=2.2.0.0, Culture=neutral, PublicKeyToken=6b7e450ec5ed63ad"/>
</Compilation>
What got me a bit was the relative path syntax in this path.