Design-Time Errors Occur on a Page Using Telerik Controls
Environment
Product | Progress® Telerik® UI for ASP.NET AJAX |
Description
When working with Telerik UI for ASP.NET AJAX or dragging a Telerik control from the ToolБox to the design surface, design-time errors occur on a page that uses Telerik controls.
Causes
Depending on the use case, the possible causes for such errors may be the following:
If the
Telerik.Web.UI.dll
assembly is updated while a page using Telerik controls is in Design-time, Visual Studio creates two different versions of the assembly. Hence, two different versions of the same Telerik controls are available.If you try to drag a Telerik control from the Toolbox to the design surface and get an error, the possible reasons are various. Refer to the resource links below.
After upgrading Telerik UI for ASP.NET AJAX to Q1 2009, Visual Studio 2008 has a problem with loading GAC-ed design-time assemblies of control libraries deployed in the
Bin
folder of a website.
Error Messages
(Two assembly versions)
Error Creating Control - Telerik control 'Property' cannot be initialized. Details: Unable to cast object of type 'Type' to type 'Type'
(Dragging a Telerik control from the ToolBox)
Error creating control. Unable to cast object of type 'Telerik.Web.UI.Radxxx' to type 'Telerik.Web.UI.ControlItemContainer
(Problem loading GAC-ed assemblies)
Error creating control - ControlName
orFailed to create designer "Telerik.Web.UI.ControlName..."
Solutions
Depending on the possible cause for this issue, use the following approaches to handle it:
(Two assembly versions) Restart Visual Studio.
-
(Dragging a Telerik control from the ToolBox) Refer to the following resources:
-
(Problem loading GAC-ed assemblies) To solve this issue, use any of the following approaches:
To
Bin
-deploy the design-time assembly, add a reference toTelerik.Web.Design.dll
to your website or application, removeTelerik.Web.Design.dll
from the GAC, and restart Visual Studio.To GAC-deploy the control library assembly, add
Telerik.Web.UI.dll
in the GAC, removeTelerik.Web.UI.dll
from yourBin
folder, and restart Visual Studio.Copy
Telerik.Web.UI.dll
toC:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies
and restart Visual Studio.