Could not load file or assembly 'EPiServer, Version=6.0.530.0

Sep 20, 2012 at 10:39 AM

I'm trying to use FakePageRepository in one of my unit tests. I have referenced EPiAbstractions, EPiAbstractions.Fakes and EPiAbstractions.Opinionated 1.9.0.0, and EPiServer 6.1.379.0 (among others). When I run the test, I get an exception even before the test method is executed: 

Initialization method RgsWeb.Tests.Classes.Application.LegacyServiceTest.Setup threw exception. System.IO.FileNotFoundException: System.IO.FileNotFoundException: Could not load file or assembly 'EPiServer, Version=6.0.530.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' or one of its dependencies. The system cannot find the file specified.=== Pre-bind state information ===
LOG: User = VARDRAD\Administrator
LOG: DisplayName = EPiServer, Version=6.0.530.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
 (Fully-specified)
LOG: Appbase = file:///D:/Source/Inera.RGS/Main/RGSWeb/Source/RgsWeb/TestResults/Administrator_RGSDEV 2012-09-20 12_28_10/Out
LOG: Initial PrivatePath = NULL
Calling assembly : EPiAbstractions, Version=1.9.0.0, Culture=neutral, PublicKeyToken=null.

Why is it trying to load EPiServer version 6.0.530.0? If I change the EPiServer reference from Copy Local False to True, I get another error:

Initialization method RgsWeb.Tests.Classes.Application.LegacyServiceTest.Setup threw exception. System.IO.FileLoadException: System.IO.FileLoadException: Could not load file or assembly 'EPiServer, Version=6.0.530.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).