There is already a content type registered for type

Found in

EPiServer.CMS.Core 7.0.586.0

Fixed in

EPiServer.CMS.Core 9.3.0

Created

Oct 06, 2015

Updated

Jun 27, 2018

Area

CMS Core

State

Closed, Fixed and tested


Description

It is possible to get duplicate rows in tblContentType: "There is already a content type registered for type <Model>".

This errors seems to be happening more often in Azure.

See report: http://world.episerver.com/forum/developer-forum/EPiServer-7-CMS/Thread-Container/2015/6/duplicate-guid-entries-inserted-in-dbo.tblcontenttype-causes-erroneous-behaviour/

Workaround To avoid duplicates GUIDs appearing run the follwing TSQL using SQL Server Management Studio, it will create a unique index on the GUID column in the content type table. The upgrade scripts will detect if this specific index is already added so it will not interfer when upgrading to a version that already have this specific fix.

CREATE UNIQUE NONCLUSTERED INDEX [IDX_tblContentType_ContentTypeGUID] ON [dbo].[tblContentType]([ContentTypeGUID] ASC);