Sitecore 10.1.0 Helix Visual Studio Project Publish issue: An error occurred loading a configuration file: Could not load type 'Sitecore.Configuration.FlexibleEnvironmentConfigBuilder' from assembly 'Sitecore.Kernel'.

Error:

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: An error occurred loading a configuration file: Could not load type 'Sitecore.Configuration.FlexibleEnvironmentConfigBuilder' from assembly 'Sitecore.Kernel'.

Source Error:

Line 19:   </RetryPolicyConfiguration>
Line 20:   <connectionStrings configSource="App_Config\ConnectionStrings.config" />
Line 21:   <appSettings configBuilders="SitecoreAppSettingsBuilder">
Line 22:     <add key="EmailReminder.FromAddress" value="name@server.net" />
Line 23:     <!-- NetSpell directory -->


Source File: c:\inetpub\wwwroot\sc1010latestsc.dev.local\web.config    Line: 21



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

Cause:

The Sitecore Kernel dll referenced in my Visual Studio project was different from what was required by the Sitecore web app instance. There are couple of things to do here:

1. I always have a backup copy of the instance bin dlls. First thing, will put back the correct version of the dll in the web root bin folder since its overwritten now

2. Next, Ensure your Visual Studio project references the correct version of Sitecore Kernel dll as needed for the Sitecore instance

3. Most importantly, Since we don't need unnecessary overwrites during the future publish, set the Copy Local for the Sitecore Kernel dll to false. 


Note: to be safe, I ensure Copy Local is set to false for all referenced dlls when I'm sure the web app root bin dll already has the necessary dll (versions)

Comments