Skip to content
December 1, 2018 / kiranpatils

How to reference and deploy Sitecore hotfix DLLs?

Challenge

Recently we were facing 503 error on our Sitecore 9.0.2 version Sitecore App deployed on Azure App (Blog on that topic soon)

We reached out to our common friends — Sitecore Support team and they gave me Two Hotfix DLLs :

  • Sitecore.Kernel
  • Sitecore.ContentSearch

Til this point of time, I got DLLs like Sitecoe.Support.SOMNUMBER.DLL and it was easy to deploy. I can copy in Assemblies/Lib folder in your directory, and reference it from your Project. And it will be deployed on higher environments.

But If you are wondering how to do it for these two DLLs? As they are coming from Sitecore’s Nuget feed in your current solution. Are you? Then this post is for you.

Solution

As you do, I also did a quick search and foud this from Sitecore’s official doc : https://doc.sitecore.com/developers/82/sitecore-experience-platform/en/sitecore-public-nuget-feed-faq.html

That was disappointing 😦 Then thought to reach out to our internal Sitecore experts and following great ideas came up:

  1. Private Nuget server : This makes sense. But have to reach out to client and ask them to spin up new nuget server and deploy DLL there. But was unable to figure out, how it will resolve from nuget references [Sitecore] and Custom nuget having same DLLs with same name.  As I was not clear and had client team’s dependencies thought to look for other solution.
  2. Local Reference : Another plan was to use old school approach, Where you created Assemblies/Libraries/Libs folder under your Project directory and instead of nuget use local reference in all your projects. But it had two challenges:
    1. We are using Helix and we have lot of projects, where we need to do these updates ~20. Which I was not sold.
    2. In future, If we have to do version upgrade. We have to again do these changes manually for all projects. Lot of work Now and in future – not efficient. So, thought to think of another approach
  3. Post build step : Another idea was to provide post build steps in last project, which copies hotfix’d DLLs. That could have fixed local development environment challenges. But we use Teamcity, Octopack and Octopus deployment and this idea would need additional steps from DevOps team. Which is fine for now. But in future — Same efforts needs to be done to undo it. So, this was also not a good idea.

Then I applied my 99 things learning, Step away from keyboard : https://github.com/97-things/97-things-every-programmer-should-know/blob/master/en/thing_69/README.md

And got a new idea:

By default nugget looks for DLL file from Packages folder and if exist, it doesn’t download and uses it as a reference DLL. For example : Sitecore.Kernel.DLL can be found under <YOURPROJDIR>\packages\Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462

This was Eureka moment. Where I thought to do this:

  1. Copy new DLL from Sitecore hotfix package and pasted it under
    <YOURPROJDIR>\packages\Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462
  2. Committed : Packages folder and
    Sitecore.Kernel.NoReferences.9.0.180604\lib\NET462 folders
  3. That’s it!
  4. it worked on Local – Teamcity and Octopus!

This helped? You found better approach than this? I’m all ears!

Happy Coding! 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: