Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alexander 3 posts 74 karma points
    Jan 15, 2018 @ 22:57
    Alexander
    1

    Cannot bind source type ... error after application update

    Hello,

    We faced a major issue on updating production machine. Even thou all changes been reverted still getting following error:

    Cannot bind source type Umbraco.Web.Models.RenderModel to model type GMCS.WebUI.Models.BaseRenderModel.
    

    or

    Umbraco.Web.Mvc.ModelBindingException: Cannot bind source type Umbraco.Web.Models.RenderModel to model type GMCS.WebUI.Models.ProductModel.
    

    etc.

    Where BaseRenderModel is(quite simple):

    public class BaseRenderModel : RenderModel
        {
            private readonly IPublishedContent _content;
            private CultureInfo _cultureInfo;
    
            public BaseRenderModel(IPublishedContent content, CultureInfo culture) : base(content, culture)
            {
                _content = content;
                _cultureInfo = culture;
            }
    
            public BaseRenderModel(IPublishedContent content) : base(content)
            {
                _content = content;
            }
    
            public BaseRenderModel() : this(new UmbracoHelper(UmbracoContext.Current).TypedContent(UmbracoContext.Current.PageId))
            {
    
            }
        }
    

    This error occurs for every page that uses either base model or models inherited from base model.

    As I mentioned above, update files were reverted but error persisted. No configuration files were modified.

    One of the problems, that we don't have access to machine beside FTP access to application root.

    So far I found 2 solutions to this problem:

    1. Clean up .NET temp fodler (works in approximate 50% of attempts, tested on staging machine while getting same issue.)
    2. Copy of application folder and change IIS app path. (this method works 100% of the time, but looks too barbarian and taking in account that no access to production machine, it makes things even more complicated.)

    I saw that this bug was discovered upon migration to version 7.4.2. After reading corresponding materials I still don't have real answer why that happens and how to avoid such situations.

    Umbraco version used - 7.5.2

    Thank you in any advice.

  • Alex Skrypnyk 4732 posts 16909 karma points MVP 2x admin c-trib
    Jan 16, 2018 @ 08:49
    Alex Skrypnyk
    1

    Hi Alexander

    Welcome to our forum!!!

    It looks like the issue similar to this issue - http://issues.umbraco.org/issue/U4-10822

    We had the same, and it's not fixed by now in Umbraco version 7.7.7, HQ told that it will be fixed in Umbraco 7.7.9

    Are you using Dll mode of ModelsBuilder?

    Thanks,

    Oleksandr

  • Alexander 3 posts 74 karma points
    Jan 16, 2018 @ 21:38
    Alexander
    0

    Hi Alex :)

    Thank you for your reply.

    For model binding current settings are:

    <add key="Umbraco.ModelsBuilder.Enable" value="false" />
    <add key="Umbraco.ModelsBuilder.ModelsMode" value="Nothing" />
    

    We tried with Dll, PureLive , and rolled back and nothing helped.

    I assume the solution is - to wait for 7.7.9 version to be safe out of that issues. :|

  • Hoang Nghia 10 posts 90 karma points
    Jan 17, 2018 @ 01:35
    Hoang Nghia
    0

    Hi Alexander, have you tried to convert to compiled code (no longer put in App_code)?

  • Alexander 3 posts 74 karma points
    Jan 19, 2018 @ 18:21
    Alexander
    0

    Hi,

    I'm not putting to App_Code. As i mention in very first post, you can just update a related objects.dll with extra property, update in bin folder, get an error, rollback and never get rid of this problem.

  • kamil1995b 14 posts 93 karma points
    Mar 20, 2018 @ 11:29
    kamil1995b
    0

    We have the same issue, but we've upgraded; from 7.7.6 to 7.7.9.

    We use PureLive (but tried setting AppData too) and uSkinned template. When the solution is uploaded to Azure, upon refreshing the CSS or clicking into a link (possibly when the ModelBuilder kicks in?), we get this error

    Cannot bind source type USNStarterKit.USNModels.USNBaseViewModel to model type USNStarterKit.USNModels.USNBaseViewModel.
    

    ... which does not make a lot of sense, considering it's a basic uSkinned install.

  • Tom Madden 197 posts 220 karma points
    1 week ago
    Tom Madden
    0

    In case anyone else get this exact issue, I edited the USNBaseViewModel (adding a space to the end of a line and saved it) to cause a recompile then reloaded the site and it worked fine after that.

    regards

    t

  • Divyesh Gohil 1 post 71 karma points
    Mar 29, 2018 @ 06:27
    Divyesh Gohil
    0

    Hi,

    I have had the same issue so I have deleted App_data/TEMP folder and its working now.

    I hope the mentioned resolution will fix your issue.

    Regards

  • Andy Carlier 15 posts 73 karma points
    Jun 07, 2018 @ 06:36
    Andy Carlier
    0

    Hiya,

    If anyone else stumbles upon this, my issue was that I hadn't quite named the document type, specifically the ID, to match the controller name when I was recreating it in a different environment (i.e. different DB).

    The dumbest of things.

    Andy.

Please Sign in or register to post replies

Write your reply to:

Draft