Sitecore errors you can encounter

Created: 23 Aug 2021, last update: 30 Jan 2022

Sitecore errors you can encounter

I encountered the following errors and did not find the solution on the internet, lucky you if you google this error because you are stuck.

Errors are taken from Sitecore 10.1 Update-1 but might be also possible on other Sitecore versions.

Could not create instance of type: Sitecore.Services.GraphQL.Hosting.GraphQLEndpoint. No matching constructor was found. Constructor parameters:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Sitecore.Exceptions.ConfigurationException: Could not create instance of type: Sitecore.Services.GraphQL.Hosting.GraphQLEndpoint. No matching constructor was found. Constructor parameters:

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:

[ConfigurationException: Could not create instance of type: Sitecore.Services.GraphQL.Hosting.GraphQLEndpoint. No matching constructor was found. Constructor parameters: ]
Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +574
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +163
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) +68
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode) +242
Sitecore.Services.GraphQL.Hosting.Configuration.GraphQLEndpointManager.CreateEndpoint(XmlNode node) +40

Possible reason: Sitecore website is running as Content Delivery and Sitecore Horizon is installed, the files are present. Solution remove the files (from package Sitecore ManagementServices and Sitecore Horizon XP integration ) or at least. App_Config\Sitecore\Services.GraphQL and bin\Sitecore.Horizon.*.dll from your CD.
Else you also can get this error:

[InvalidOperationException: No service for type 'Sitecore.Horizon.Integration.ExternalProxy.ISitecoreContext' has been registered.]

Note: the server rol is defined in the web.config <add key="role:define" value="ContentDelivery" />

 

Another error that can occur:
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 file or assembly 'Sitecore.Kernel' or one of its dependencies. The system cannot find the file specified.

Source Error:

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

Source File: C:\inetpub\wwwroot\sc1011cd1.sc\web.config Line: 22

Possible reason missing some .dll, the error Could not load file or assembly 'Sitecore.Kernel' or one of its dependencies. Is pretty clear. It doesn't have to be file permissions. Maybe you just miss some .dll’s in my case because IT security Policy some .dll were stopped when copying. Despite that the Sitecore.Kernel was present I missed a lot of other dll’s.

Solution, get the dll’s. Tip all .dll or at least the one that are needed by the Sitecore.Kernel are present in the Sitecore 10.1.1 rev. 005862 (OnPrem)_single.scwdp.zip you can find on dev.sitecore.net. If you have the same security permission I experienced. Try to copy the .dll with the Visual Studio Command Line in my case Visual Studio has elevated rights.