Feedback
Did this article resolve your question/issue?

   

Article

Upgrade: "The type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception."

« Go Back

Information

 
TitleUpgrade: "The type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception."
URL Nameupgrade-the-type-initializer-for-telerik-sitefinity-localization-res-threw-an-exception
Article Number000179880
EnvironmentProduct: Sitefinity
Version: 8.x, 9.x
OS: All supported OS versions
Database: All supported Microsoft SQL Server versions
Question/Problem Description
Runtime error after upgrade on initialization (startup) screen:
"The type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception." 
Steps to Reproduce
Clarifying Information
Error MessageThe type initializer for 'Telerik.Sitefinity.Localization.Res' threw an exception.
Defect Number
Enhancement Number
Cause
This is caused by the App_Data folder being readonly or missing assemblies in the Bin folder.
Resolution
Option 1
  • Make the App_Data folder of the project not ready only - uncheck the Read-only property and apply changes to this folder, subfolders and to all files in it.
  • Restart the project
Option 2
  • Copy all the assemblies from _EmptyProject/Bin folder and paste them in your project's Bin folder
  • Restart the application, which should trigger the upgrade.
Option 3
If the version of Newtonsoft.Json.DLL is older than the version from Sitefinity's _EmptyProject:
  • In Visual Studio, open the Package Manager Console
  • Type "Update-Package Newtonsoft.json -version 9.0.1"
  • Save and rebuild the project
  • Copy the DLLs from the _EmptyProject folder to the project's bin folder
  • Resolve any assembly version mismatch
Workaround
Notes
A blank space in the beginning of a configuration file could also trigger this exception. E.g:
 
<?xml version="1.0" encoding="utf-8"?>

In the above markup the space character will be located in the very beginning of the file, before the < character
 
Last Modified Date5/2/2017 7:37 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.