+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Object does not match target type.

Object does not match target type.

2 posts, 0 answered
  1. Annie
    Annie avatar
    123 posts
    Registered:
    08 Apr 2009
    11 Aug 2010
    Link to this post

    Hi,

    I am getting the following error when I try to add a usercontrol to the page:

     

    Server Error in '/' Application.

    Object does not match target type.

    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: System.Reflection.TargetException: Object does not match target type.

    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:

    [TargetException: Object does not match target type.]
       System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) +7519931
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +105
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
       System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) +100
    
    [TargetInvocationException: Property accessor 'ID' on object 'Telerik.Cms.Engine.WebControls.GenericContent' threw the following exception:'Object does not match target type.']
       System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) +390
       Telerik.Cms.Data.WebControlBase.SaveControlState(Control control, Control defCtrl, PropertyDescriptorCollection properties) +433
       Telerik.Cms.Data.WebControlBase.SaveControlState(Control control) +193
       Telerik.Cms.Data.WebControlBase.VerifyObject() +31
       Nolics.ORMapper.Base.OdbClassHelper.VerifyClass(IOdbClass cl) +41
       Telerik.Cms.Data.WebControlBase.Nolics.ORMapper.Base.IOdbClass.BeginCommit() +12
       Nolics.ORMapper.Base.Transaction.Commit(Boolean fCleanIfSuccess) +909
       Nolics.ORMapper.Base.Transaction.Commit() +9
       Telerik.Cms.Data.StagedPage.AddControl(String containerId, ICmsWebControl cmsControl, Int32 ordinal) +314
       Telerik.Cms.Data.StagedPage.AddControl(String containerId, Type type, Int32 ordinal, String controlId) +139
       Telerik.Cms.Web.UI.ToolBar.AddContol(String controlName, String zoneId, Int32 ordinal) +349
       Telerik.Cms.Web.UI.Toolbox.Button_Command(Object sender, CommandEventArgs e) +330
       System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +108
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    



    Thanks,
    Annie
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Aug 2010
    Link to this post
    Hello Annie,

    The error seems to be thrown from Telerik.Cms.Engine.WebControls.GenericContent . Are you trying to drop one of the built-in controls or you have a custom one? If it is a custom one does the problem appears only when you try to drop it. If you use an embedded control could you provide some steps that we can follow to reproduce the issue, because we have not encountered such issue so far. You might find this post useful - Object does not match target type

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered