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

Forums / General Discussions / Object does not match target type.

Object does not match target type.

5 posts, 0 answered
  1. Scott Bradley
    Scott Bradley avatar
    27 posts
    Registered:
    20 Jan 2010
    18 Feb 2011
    Link to this post
    I am getting the following error any time I change any code in a custom .ascx and refresh the page in sitefinity.  I have to go into the admin side, open up the page and then it magically works.  I could do something as simple as just add a response.write and it crashes.  I've just migrated from 3.7 where this wasn't a problem.  Help other posts about this haven't helped.

    By the way, telerik, slightly disappointed in 4.0.  3.7 seemed way more developer friendly and got out of our way.  :(

     

    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.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value) +385
       Telerik.Sitefinity.Modules.Pages.PropertyBuilder.SetProperty(Object component) +543
       Telerik.Sitefinity.Modules.Pages.ControlBuilder.CreateControl(Page page) +182
       Telerik.Sitefinity.Modules.Pages.PageHelper.CreateChildControls(IList`1 controls, Page page, Boolean ignoreCultures) +395
       Telerik.Sitefinity.Modules.Pages.StaticPageData.CreateChildControls(Page page, Boolean isFrontEndPage) +498
       Telerik.Sitefinity.Web.PageRouteHandler.ApplyLayoutsAndControls(Page page, RequestContext requestContext) +273
       Telerik.Sitefinity.Web.RouteHandler.InitializeContent(Page handler, RequestContext requestContext) +276
       Telerik.Sitefinity.Web.RouteHandler.Handler_Load(Object sender, EventArgs e) +215
       System.Web.UI.Control.OnLoad(EventArgs e) +91
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Feb 2011
    Link to this post
    Hi Scott,

    Do you use web application or website? Generally you should build the solution after making changes to the files when you work with web application.

    Greetings,
    Ivan Dimitrov
    the Telerik team
  3. Scott Bradley
    Scott Bradley avatar
    27 posts
    Registered:
    20 Jan 2010
    21 Feb 2011
    Link to this post
    I was pointing to the site as a Web site, so I would expect it to refresh fine.  Is there a setting that I am missing in the 4.0 admin or setup?  3.7 worked fine in the method I was using now and expected 4.0 to be the same.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Feb 2011
    Link to this post
    Hi Scott,

    By default we ship Sitefinity as a web application, which means that each change to a class or control inside the application requires to build it. If this is a web site such a change are not required.

    Can you replicate this issue with new website? I am not able to replicate the issue locally.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
  5. Scott Bradley
    Scott Bradley avatar
    27 posts
    Registered:
    20 Jan 2010
    25 Feb 2011
    Link to this post
    I'm not sure what you mean, "If it's a Web site".  You're telling me that it's not, that it's a Web app.  So, it is the case that I need to rebuild everytime.  That's fine, I guess.  I mean, I think Web sites are easier to build in and I'm disappointed in the change.  I think that's a step backwards, but I can see where people disagree.  Whatever, at least I understand what's going on.
5 posts, 0 answered