Apply patch to web.config in sitecore

I am little new to sitecore and I got a work thats bugging me. I was given a task to applying sitecore patches to the project and deploy to Dev. There were 3 patches. I completed the first two as it was to applied in Sitecore.config file. The third patch was to add config in "appSettings" node and "assemblyBinding" node in Web.config file. When I used the traditional way of patching like I used for the first two, I was getting an error and later I found out this:

My project doesn't use slowcheetah. I researched more about this and found that I have to do web config transforms. The more I researched how to do transforms more confused I got. Below are the config that I have to insert in Web.config :

Under appSetting node :

<add key="Telerik.AsyncUpload.ConfigurationEncryptionKey" value="YOUR_ENCRYPTION_KEY_HERE" />

Under appSetting node :

<dependentAssembly>
        <assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" />
        <bindingRedirect oldVersion="2015.1.401.45" newVersion="2017.2.621.45" />  
      </dependentAssembly> 

I was hoping to get a simple solution or references to articles on how to do insert these configs in web.config file.

  • Hi Kautilya,

    These are the setting are not come under Sitecore  Node. There are something .Net related configuration ,So create the transformation file.

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/transform-webconfig?view=aspnetcore-3.1

    sample code like 

     

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration xmlns:xdt="schemas.microsoft.com/XML-Document-Transform">
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

    <dependentAssembly xdt:Transform="RemoveAll"
    xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Security.Cryptography.Algorithms')"></dependentAssembly>
    <dependentAssembly xdt:Transform="Insert">
    <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" xmlns="urn:schemas-microsoft-com:asm.v1" />
    <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.0.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    </configuration> 

    Let me know if you have any issue,

    Thanks,

    Vikas Chauhan

    Sitecore Architect

    HCL Technology