The configuration section dataCacheClients’cannot be read because it is missing a section declaration

Hi all my name is Angshuman and I work with the Cloud Integration Engineering team at Microsoft. I was assisting a developer who had reported that after installing the latest Nuget Cache package the Web Role started getting the following exception.

The WebRole was redeployed after the new Cache dlls were used and it got the following error. 

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

 

Module IIS Web Core

Notification Unknown

Handler Not yet determined

Error Code 0x80070032

Config Error The configuration section dataCacheClients’cannot be read because it is missing a section declaration

Config File \\?\F: \sitesroot\0\web.config 

Requested URL https://100.81.82.47:80/

Physical Path

Logon Method Not yet determined

Logon User Not yet determined

Request Tracing Directory : C :\Resources\directory\5Oabl Soflclb4l4abocb6fcfeae5bb96.MSWebRole.DiagnosticStore\FailedReqLogFiles\Web

Config Source:

322: </system.identityModel .services>

323: <dataCacheClients>

324: <dataCacheClient>

 

This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.

The error is very evident, as per https://msdn.microsoft.com/en-us/library/jj131262.aspx we need to have a name for the dataCacheClient which is missing in the configuration file.

 We also noticed by comparing the web.config with the previous version in TFS that the following sections were removed.

<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />

<section name="cacheDiagnostics" type="Microsoft.ApplicationServer.Caching.AzureCommon.DiagnosticsConfigurationSection, Microsoft.ApplicationServer.Caching.AzureCommon" allowLocation="true" allowDefinition="Everywhere" />

 So we added these and redeployed the role and it came up fine.