2

I am trying to test my Sharepoint custom code, using Microsoft.SharePoint.Emulator with VS2012 Premium ( because I have MSDN Premium subscription) I know its officially comes with VS Ultimate version, but somehow I download the dlls : • Microsoft.SharePoint.Emulators • Microsoft.QualityTools.Testing.Fakes • Microsoft.QualityTools.Testing.Emulators When I test my code:

[TestMethod] public void TestGetABCInformation() { using (new SharePointEmulationScope()) { DataTable dt = new DaoObjects.ABCDAO().GetRequestTriggers(); } } 

I got this error I tried a lot but can’t solve this issue.

System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.2.0.0.0.Fakes, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0ae41878053f6703' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. Kindly share your opinion about it.

2
  • Try and check the target framework currently selected for the test project? I suspect it is switched to framework 4/4.5. Try to set it back to framework 3.5 and see if that works. Commented Feb 5, 2014 at 14:43
  • I tried a lot to switched back to 3.5 but no luck still gets the same error "System.Web.2.0.0.0.Fakes" Commented Feb 9, 2014 at 10:28

1 Answer 1

0

Are you using NuGet Package Manager to install the Emulators package? If so, that's what I did to resolve it:

  1. Change the project's target framework back to 3.5
  2. Remove the Microsoft.CSharp reference from the project
  3. Remove the Microsoft.SharePoint.Emulators package from the project (via NuGet Package Manager)
  4. Re-Add the Microsoft.SharePoint.Emulators package to the project (via NuGet Package Manager)

Et voila, everything works fine again. Hope this helps.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.