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
- Run the SharePoint Products Configuration Wizard to perform the required upgrades.
- 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
- 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
Permalink
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?
Permalink
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
Permalink
This article has now been updated with an approved workaround for zero-downtime-patching
Permalink
Thank you very much. Works like a charm.
Permalink
Is this an issue for SE only?
Permalink
Yes.
Permalink
I have just installed 11 jun 2024 SP SE patch KB5002603.
Guess what – I only made my sites available again, after reading this website, about this silly “owin” hiccup from Microsoft Sharepoint developers in their March 2024 update.
I am quite honestly stunned that a mishap like this, in March has STILL not been corrected in their June patch.
Why don’t Microsoft learn from their mistakes – do they not care about SP at all? If not, then why do we still buy/use the behemoth product then . . .
But thanks, Stefan Goßner!! – Without you, Microsoft Sharepoint Support would be seriously overloaded with work 😀
Permalink
Thank you.
Ran into this after installing KB5002606.
Running the Configuration Wizard brought our main site back online, but I was still running into this error when attempting to access our Central Administration Site. Was able to use your zero downtime patching instructions to update the Central Admin web.config to point at the new assembly version manually. Not sure why the Configuration Wizard updated the main site web.config to 4.2.2.0 but not the Central Admin web.config.