Creating Module

Posted by Community Admin on 05-Aug-2018 12:46

Creating Module

All Replies

Posted by Community Admin on 18-Apr-2011 00:00

Hi,
I'm a newbie with Sitefinity.
Now I'm trying to clone the Product Sample with Sitefinity 4.
I've got this Exception when I drag the widget into a page :
[TargetInvocationException: Property accessor 'ControlDefinition' on object 'ProductCatalogSample.Web.UI.Public.ProductDetailsView' threw the following exception:'Object does not match target type.']
What's wrong here ?
Thank You
Toky

Posted by Community Admin on 18-Apr-2011 00:00

Hello Toky,

Can you give me the stack trace so I can see where the error is occurring.  Also can you tell me how did you bind your control. If you include the source of your control so we can have a look at it locally would be nice.

Kind regards,
Victor Velev
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Posted by Community Admin on 18-Apr-2011 00:00

Hi Victor,
Thank you for your reply,

Here is the entire stack trace


Server Error in '/Product' 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) +9355927
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +100
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.SecurityUtils.MethodInfoInvoke(MethodInfo method, Object target, Object[] args) +163
   System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) +109

[TargetInvocationException: Property accessor 'ControlDefinition' on object 'ProductCatalogSample.Web.UI.Public.ProductDetailsView' threw the following exception:'Object does not match target type.']
   System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) +400
   Telerik.Sitefinity.Modules.Pages.Web.Services.WcfPropertyManager.AddPropertiesRecursively(Object instance, IList`1 list, List`1 propertyDescriptorHierarchy, ControlData controlData, Int32 depth, CultureInfo culture) +208
   Telerik.Sitefinity.Modules.Pages.Web.Services.WcfPropertyManager.AddPropertiesRecursively(Object instance, IList`1 list, List`1 propertyDescriptorHierarchy, ControlData controlData, Int32 depth, CultureInfo culture) +367
   Telerik.Sitefinity.Modules.Pages.Web.Services.WcfPropertyManager.GetProperties(Object instance, ControlData controlData, Int32 depth, String parentPropertyPath, CultureInfo culture) +253
   Telerik.Sitefinity.Web.UI.PropertyEditor.GetPropertyBag() +145
   Telerik.Sitefinity.Web.UI.PropertyEditor.GetScriptDescriptors() +688
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +126
   Telerik.Sitefinity.Web.UI.AjaxDialogBase.Render(HtmlTextWriter writer) +103
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +65
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +270
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +9
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +65
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +270
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +177
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +311
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +65
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +270
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +9
   System.Web.UI.Page.Render(HtmlTextWriter writer) +30
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +65
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +270
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8662

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

--------------------------------------------------------
I juste copy the sample project Products, then, I've referenced the ProductCatalogSample.dll
Is there any tutorial or a sample Helloworld-like project I should read ?

Thanks again,
Toky


Posted by Community Admin on 18-Apr-2011 00:00

Hello Toky,

The problem may be coming from the registration of the control into the system. Please consider reviewing the following article which is related to your module.

Greetings,
Victor Velev
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Posted by Community Admin on 19-Apr-2011 00:00

Hello Victor,

Thank you for your answers. I will review this article again

Toky

Posted by Community Admin on 19-Apr-2011 00:00

Hi Toky,

Please feel free to contact me again if you have more questions or need some more explanations. I will be closing the thread but you can open new one at a later moment if you need to.

Kind regards,
Victor Velev
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

This thread is closed