I am getting error:

  Message=Could not load file or assembly '**Sitecore.Abstractions**, 
  Version=, Culture=neutral, PublicKeyToken=null' or one of its 
  dependencies. The system cannot find the file specified.

at runtime, while trying to execute a Unit Test method. I did not find this dll anywhere. Anyone has any idea this particular DLL?

Regards, Chandana


Quoting Ruud van Falier (Sitecore.Abstractions.dll in Sitecore 7.5):

Sitecore 7.5 ships with a new binary named Sitecore.Abstractions.dll This offers you abstractions for some parts of the Sitecore API that are implemented as static classes in the kernel. Being static classes, there is no way to run unit tests on code that is depending on them without running from within a Sitecore application.

If you ever tried unit testing in Sitecore, you will know that if you call Sitecore.Configuration.Settings.GetSetting("MySettingKey"), for example, it will always be null. Because the unit test does not actually load the Sitecore application, it will have no configuration in memory and thus no access to settings.

That dll should be in the bin folder of your web application.

Or you can download it from nuget: https://sitecore.myget.org/feed/sc-packages/package/nuget/Sitecore.Abstractions

| improve this answer | |
  • No, this DLL was not present. We can get it via Sitecore nuget package and that worked for me. – Chandana Aug 22 '19 at 4:37

I am using Sitecore 8.2 update 5 and Sitecore.Abstractions dll was not present in the bin. We can add Sitecore nuget sourceSitecore nuget package source

And install it from there

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.