0

As part of Sitecore Upgradation from 9.3 to 10.3, I have upgraded code and database. We have deployed code in Azure web app using Azure piplines, the problem here in CM sitecore instance is everything fine but in CD environment getting below exception.

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Method not found: 'Void StackExchange.Redis.SocketManager..ctor(System.String, Int32, Boolean)'.

Source Error:

An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Source File: C:\home\site\wwwroot\web.config    Line: 296


Click here to show additional error information:

Exception Details: System.MissingMethodException: Method not found: 'Void StackExchange.Redis.SocketManager..ctor(System.String, Int32, Boolean)'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: 'Void StackExchange.Redis.SocketManager..ctor(System.String, Int32, Boolean)'.]
   Sitecore.SessionProvider.Redis.RedisUtility.ExtractConfigurationOptions(ProviderConfiguration configuration) +0
   Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync..ctor(ProviderConfiguration configuration, RedisUtility redisUtility) +25
   Sitecore.SessionProvider.Redis.RedisConnectionWrapperAsync..ctor(ProviderConfiguration configuration) +139
   Sitecore.SessionProvider.Redis.RedisSessionStateProviderAsync.Initialize(String name, NameValueCollection config) +312
   System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +693

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0

Based on above exception I was suspected some lower version dll getting loaded for above exception and checked StackExchange.Redis dll and pointed to correct version only.

Could you please help me which Lower version DLL version loaded here.

1
  • It is unlikely that this problem can be solved by a simple answer on SSE - this will probably need some in depth debugging. You would be better off taking it to Sitecore Slack
    – Richard Seal
    Commented Sep 8, 2023 at 18:05

1 Answer 1

0

The error you are encountering, Method not found: 'Void StackExchange.Redis.SocketManager..ctor(System.String, Int32, Boolean)', suggests that a method expected by your application is missing from the version of the StackExchange.Redis assembly that is being loaded at runtime. This is a common symptom of a version mismatch, where the version of the assembly being used at runtime is different from the version that the application was built against.

Here's a breakdown of potential issues and steps to troubleshoot and resolve this error:

  1. Incorrect Version of StackExchange.Redis:

    • Ensure that the version of the StackExchange.Redis DLL you have deployed matches the version you used during development.
    • Check the version of StackExchange.Redis that is specified in your project file or packages.config file, and ensure that this version is the one that is deployed to your Azure environment.
  2. Binding Redirects:

    • Check your web.config file for binding redirects related to StackExchange.Redis. If there are binding redirects present, ensure that they are correctly redirecting to the version of StackExchange.Redis that you have deployed.
    • For example, a binding redirect might look like this:
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="StackExchange.Redis" publicKeyToken="50b63e6b07e547e7" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2.2.4.0" newVersion="2.2.4.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      
  3. Mixed Assembly Versions:

    • It's possible that another assembly in your application is referencing a different version of StackExchange.Redis.
    • You can use a tool like ILSpy or dotPeek to inspect the references of your assemblies.
  4. Deployment Issues:

    • Ensure that the correct version of StackExchange.Redis DLL is being deployed to your Azure environment.
    • Check the bin directory of your deployed application to verify the version of StackExchange.Redis that is present.
  5. Local Testing:

    • If possible, replicate the CD environment locally and test to see if you experience the same error.
    • Debugging the application locally might provide more insight into the error and the version of StackExchange.Redis that is being loaded.

By following these steps, you may be able to identify and resolve the version mismatch causing the MissingMethodException in your application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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