Trending issue: Could not load file or assembly ‘Microsoft.Owin, Version=3.0.1.0, …’ after installing March 2024 CU for SPSE

Several customers reported an issue after installing SharePoint Server Subscription Edition March 2024 CU which includes the 24H1 Feature Update:

Exception type: FileNotFoundException
Exception message: Could not load file or assembly ‘Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

Background

The behavior is expected.
SharePoint Server Subscription Edition ships with a new version of the Microsoft.OWin.dll with version 4.2.2.0. By just installing the binaries on the disk the references in the web.config – which contain the strong assembly name including the version 3.0.1.0 – are not able to load the new version of the file.

Solution

The problem is resolved using one of the following steps after the fix has been installed

  1. Run the SharePoint Products Configuration Wizard to perform the required upgrades.
     
  2. Run the command line version of the configuration wizard PSCONFIG.EXE with the following parameters:
    PSConfig.exe -cmd upgrade -inplace b2b -wait -cmd applicationcontent -install -cmd installfeatures -cmd secureresources -cmd services -install
    
  3. Run these PowerShell commands:
    Initialize-SPResourceSecurity
    Install-SPService
    Install-SPFeature -AllExistingFeatures
    Install-SPApplicationContent
    Upgrade-SPFarm
    

After performing one of these 3 operations the assembly references for the Microsoft.OWin.dll in the web.config will be updated to match the new assembly version.

What about zero downtime patching?

Without running the SharePoint Configuration Wizard the assembly referenes in the web.config will be incorrect. Which means that adding the server back into the load balancer after applying the fix will cause the problem to occur.

Workaround to apply March 2024 CU with zero downtime patching:

Before adding the server back into load balancing after applying the fix edit all web.config files for SharePoint web applications (including the central administration site) and locate the following section:

<dependentAssembly>
  <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>

replace it with this updated content:

<dependentAssembly>
  <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
</dependentAssembly>

As always when using zero-downtime-patching or when delaying the run of the SharePoint Configuration Wizard after applying a patch execute the following PowerShell command to ensure that all binaries are copied to the application directory – otherwise you might end up with a version mix of assemblies which can lead to a variety of problems:

Install-SPApplicationContent

6 Comments


  1. Hello Stefan,
    after upgrading SharePoint Server 2016 (from 16.0.5430.1000) and running SharePoint Products Configuration Wizard we have an issue with Microsoft Identity Manager (was already patched to the latest version) which might be correlated to the above issue. The portal shows the message:

    Sorry, something went wrong
    Could not load type ‘Microsoft.IdentityManagement.WebUI.Controls.Site’.

    Details from ULS log:

    System.Web.HttpException:
    Could not load type ‘Microsoft.IdentityManagement.WebUI.Controls.Site’.
    at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)
    at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly)
    at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)

    Could this be related?

    Reply

    1. Hi Mike,
      this cannot be related.
      This article focuses on SharePoint Server Subscription Edition – not SP2016.

      In addition the error talks about an assembly from Windows Identity Manager.
      We do not ship this assembly – so we did not install a different version which could have cause such an issue.

      Cheers,
      Stefan

      Reply

  2. This article has now been updated with an approved workaround for zero-downtime-patching

    Reply

    1. Thank you very much. Works like a charm.

      Reply

  3. Is this an issue for SE only?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.