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:
Clean up .NET temp fodler (works in approximate 50% of attempts, tested on staging machine while getting same issue.)
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.
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.
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.
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.
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).
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:
or
etc.
Where BaseRenderModel is(quite simple):
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:
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.
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
Hi Alex :)
Thank you for your reply.
For model binding current settings are:
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. :|
Hi Alexander, have you tried to convert to compiled code (no longer put in App_code)?
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.
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
... which does not make a lot of sense, considering it's a basic uSkinned install.
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
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
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.
is working on a reply...