Issue
After upgrading from 4.7 to 5.4, K2 service is unable to start. When opening the K2 service in console mode, the following error is shown:
Error occurred while trying to load the Dependency Service. Check that the dependency service was correctly configured in Host Server's .config file
You should also find a similar error in HostServer logs.
Resolution
This is caused by the SourceCode.Hosting.Services.DependancyService.dll in [Program Files]K2 blackpearlHost ServerBinHostedServices. This assembly is no longer required in 5.4 and should be removed.
After removing the assembly, you need to edit K2HostServer.exe.config, and remove the following line:
<add key="dependancyservice" value="SourceCode.Hosting.Services.DependancyService" />
Once you are done, save the changes to K2HostServer.exe.config, and restart your K2 service.