Tuesday, April 11, 2017

Sitecore Habitat Hanging on 05-Sync-Unicorn

I was setting up Sitecore Habitat on my local environment, and while running the "default" gulp task, everything went smoothly except 05-Sync-Unicorn, it's hanging for ages, if you have the same issue follow the steps below:

  • Make sure MongoDB is running.
  • Make sure WFFM is installed.
  • Make sure to unblock following files in the code repository, you can do so by right click on each one of them and click on "Unblock":
    • Habitat-master\scripts\Unicorn\MicroCHAP.dll
    • Habitat-master\scripts\Unicorn\Sync.ps1
    • Habitat-master\scripts\Unicorn\Unicorn.psm1

  • If the task 05-Sync-Unicorn still hangs then 
    • Navigate to [Code Folder]\scripts\Unicorn\Sync.ps1 and comment out the line
      • $ErrorActionPreference = 'Stop' by adding # in the begining.
    • Navigate to [Code Folder]\scripts\Unicorn\Unicorn.psm1 and comment out the same line $ErrorActionPreference = 'Stop' by adding #.
    • Now run the step 05-Sync-Unicorn and you should start receiving actual errors that cause this step to hang, in my case I received this error
      • Could not load file or assembly 'file:///<Path>  Error: r\scripts\Unicorn\MicroCHAP.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded, And this was caused by PowerShell version, the installed version on my machine was V2 while the required version is V4 so I solved this issue by upgrading PowerShell to V4 (I installed Windows Management Framework 4.0) and the Sync unicorn task worked like a charm.
Hope that solved the issue at your end :).

2 comments:

Sitecore Fix Personalize Button is not Opening Personalization Dialog

Hi, Have you ever encountered an issue where clicking "Personalize button" ain't doing nothing? The solution is pretty si...