U4-9493 - 'System.Dynamic.ExpandoObject' does not contain a definition for 'alias'

Created by Richard Soeteman 06 Feb 2017, 09:26:33 Updated by Sebastiaan Janssen 28 Feb 2017, 10:52:43

Tags: Unscheduled Gold partner Regression

Relates to: U4-9560

When you are uysing the Old DocumentType API. You will receive the following Exception when you use the API call DocumentType.PropertyTypes

'System.Dynamic.ExpandoObject' does not contain a definition for 'alias' 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: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'alias'

Source Error:

Line 156: var eh = value as ExceptionHolder; Line 157: if (eh != null) throw eh.Exception; // throw once! Line 158: return value; Line 159: } Line 160:

Source File: F:\umbraco\Umbraco source\Umbraco-CMS-release-7.5.8\src\Umbraco.Core\Cache\HttpRuntimeCacheProvider.cs Line: 158

Stack Trace:

[RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'alias'] Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem, Nullable1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency) in F:\umbraco\Umbraco source\Umbraco-CMS-release-7.5.8\src\Umbraco.Core\Cache\HttpRuntimeCacheProvider.cs:158 Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem, Nullable1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) in F:\umbraco\Umbraco source\Umbraco-CMS-release-7.5.8\src\Umbraco.Core\Cache\HttpRuntimeCacheProvider.cs:168 Umbraco.Core.Cache.DeepCloneRuntimeCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem, Nullable1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) in F:\umbraco\Umbraco source\Umbraco-CMS-release-7.5.8\src\Umbraco.Core\Cache\DeepCloneRuntimeCacheProvider.cs:102 Umbraco.Core.Cache.CacheProviderExtensions.GetCacheItem(IRuntimeCacheProvider provider, String cacheKey, Func1 getCacheItem, Nullable1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) in F:\umbraco\Umbraco source\Umbraco-CMS-release-7.5.8\src\Umbraco.Core\Cache\CacheProviderExtensions.cs:22 umbraco.cms.businesslogic.ContentType.get_PropertyTypes() in F:\umbraco\Umbraco source\Umbraco-CMS-release-7.5.8\src\umbraco.cms\businesslogic\ContentType.cs:604 SEOChecker.Core.Extensions.UmbracoExtensions.DocumentTypeExtensions.GetPropertiesAsList(DocumentType dt) +15 SEOChecker.Pages.Settings.DocumentTypeSettings.() +40 System.Web.UI.Control.InitRecursive(Control namingContainer) +166 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1839

This is because the PropertyType constructor is getting the field 'alias' instead of 'Alias' from the database.

Comments

Richard Soeteman 06 Feb 2017, 10:54:53

Have fixed this. Pull Request https://github.com/umbraco/Umbraco-CMS/pull/1732


Chris Köhler 06 Feb 2017, 11:59:28

Thanks @rsoeteman That's super important for us. We always try to use the current Umbraco version and SEO Checker is standard for almost all of our projects.@sebastiaan, if anyhow possible please include in the next release. Thanks


Sören Deger 06 Feb 2017, 12:49:42

@sebastiaan Maybe can we get a hotfix from you? Because we can't wait 15 days to the 7.5.10 release.


Sebastiaan Janssen 09 Feb 2017, 13:32:45

Thanks @rsoeteman ! I didn't realize that we broke this only very recently. Sorry about that. I've merged it in now and once the new build is done you can download the latest artifacts that include this fix: https://ci.appveyor.com/project/Umbraco/umbraco-cms-hs8dx/build/6355/artifacts

That build also includes the following commits, which have been reviewed and will be released in v7.5.10: https://github.com/umbraco/Umbraco-CMS/compare/master-v7...dev-v7

Regarding another question around this issue: of course there's not been any database changes, we don't do those in patch releases (7.5.10 is a patch release: Major.Minor.Patch).


Jeavon Leopold 21 Feb 2017, 17:43:21

Did this make it into 7.5.10 as I'm seeing it in that very version with SEO checker?


Jeavon Leopold 21 Feb 2017, 18:34:26

Ok, so I'm seeing the below error when trying to edit a node that is outside of the "homepage" node structure and doesn't have a domain, if I add a fake domain to the outside node it loads ok.

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'Alias' at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at CallSite.Target(Closure , CallSite , Object ) at umbraco.cms.businesslogic.propertytype.PropertyType..ctor(Int32 id) at umbraco.cms.businesslogic.property.Property..ctor(Property property) at umbraco.cms.businesslogic.Content.b__f(Property x) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at umbraco.cms.businesslogic.Content.InitializeProperties() at umbraco.cms.businesslogic.Content.getProperty(String alias) at SEOChecker.Core.Extensions.UmbracoExtensions.DocumentExtensions.GetUrlName(Document document) at SEOChecker.Core.Repository.Umbraco.UmbracoDomainRepository.GetRootNodes() at SEOChecker.Core.Repository.Umbraco.UmbracoDomainRepository.GetDomainNodes(IContextInfo context) at SEOChecker.Core.Repository.Umbraco.UmbracoDomainRepository.GetRootNodesForDomain(IContextInfo context) at SEOChecker.Core.Repository.Umbraco.UmbracoDomainRepository.GetRootNodeForDomain(IContextInfo context) at SEOChecker.Core.Extensions.HttpContextExtensions.GetNotfoundPageConfig(HttpContext context) at SEOChecker.Handlers.NotFoundHandlers.Inbound404Handler.Execute(String url) at Umbraco.Web.Routing.ContentFinderByNotFoundHandlers.HandlePageNotFound(PublishedContentRequest docRequest) at Umbraco.Web.Routing.ContentFinderByNotFoundHandlers.TryFindContent(PublishedContentRequest docRequest) at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate) at Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContent() at Umbraco.Web.Routing.PublishedContentRequestEngine.TryRouteRequest() at Umbraco.Web.Routing.UrlProviderExtensions.GetContentUrls(IContent content, UmbracoContext umbracoContext) at lambda_method(Closure , IContent ) at AutoMapper.DelegateBasedResolver2.Resolve(ResolutionResult source) in c:\dev\AutoMapper\src\AutoMapper\Internal\DelegateBasedResolver2.cs:line 22 at AutoMapper.NullReferenceExceptionSwallowingResolver.Resolve(ResolutionResult source) in c:\dev\AutoMapper\src\AutoMapper\Internal\NullReferenceExceptionSwallowingResolver.cs:line 18 at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable1 source, TAccumulate seed, Func3 func) at AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.MapPropertyValue(ResolutionContext context, IMappingEngineRunner mapper, Object mappedObject, PropertyMap propertyMap) in c:\dev\AutoMapper\src\AutoMapper\Mappers\TypeMapObjectMapperRegistry.cs:line 116


Mikkel Holck Madsen 21 Feb 2017, 21:06:35

This seems to still be there like @crumpled_jeavon writes about. Its not exactly the same stacktrace, but the exception mssage is the same. Seeing this on all sites using SEOChecker that has been upgraded to 7.5.10

2017-02-21 20:12:11,085 [P7260/D3/T16] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'Alias'
   at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency)
   at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
   at Umbraco.Core.Cache.DeepCloneRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
   at umbraco.cms.businesslogic.ContentType.get_PropertyTypes()
   at SEOChecker.Core.Helpers.UmbracoDocumentHelper.GetPropertyAliasByDataType(String doctype, Guid dataTypeId)
   at SEOChecker.Core.Umbraco.DocumentWrappers.UmbracoDocument.get_SEOCheckerPropertyAlias()
   at SEOChecker.Library.MetaData.()
   at SEOChecker.Library.MetaData.()
   at SEOChecker.PropertyEditorConverters.SEOCheckerMetadataConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview)
   at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value()
   at Umbraco.Web.PublishedPropertyExtension.GetValue[T](IPublishedProperty property, Boolean withDefaultValue, T defaultValue)
   at Umbraco.Web.PublishedContentExtensions.GetPropertyValue[T](IPublishedContent content, String alias, Boolean recurse, Boolean withDefaultValue, T defaultValue)
   at Umbraco.Web.PublishedContentExtensions.GetPropertyValue[T](IPublishedContent content, String alias)
   at ASP._Page_Views_Home_cshtml.Execute() in c:\inetpub\wwwroot\Views\Home.cshtml:line 12


Jeavon Leopold 22 Feb 2017, 10:49:12

The exception only occurs when domains have been added to some root nodes but not all, if no domains have been added then all is ok also.


Stephan 22 Feb 2017, 14:36:56

Discussion moved over to U4-9560


Nigel Morris 27 Feb 2017, 15:07:34

Similar error on the Insert xslt:value-of

'System.Dynamic.ExpandoObject' does not contain a definition for 'Alias'

RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'Alias'] CallSite.Target(Closure , CallSite , Object ) +361 System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +487 CallSite.Target(Closure , CallSite , Object ) +304 umbraco.cms.businesslogic.propertytype.PropertyType..ctor(Int32 id) +3097 umbraco.cms.businesslogic.propertytype.PropertyType.GetPropertyTypes() +304 umbraco.developer.xsltInsertValueOf.Page_Load(Object sender, EventArgs e) +744 System.Web.UI.Control.OnLoad(EventArgs e) +109 umbraco.BasePages.BasePage.OnLoad(EventArgs e) +38 System.Web.UI.Control.LoadRecursive() +68 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4498


Kevin Jump 28 Feb 2017, 09:19:20

Hi I am getting a similar error - when performing a rollback on site(s) recently upgraded Umbraco v7.5.10 (see below)

'''Is this likely to be the same issue or shall i raise an new issue?'''

Server Error in '/' Application.

'System.Dynamic.ExpandoObject' does not contain a definition for 'Alias'

Description: An unhanded 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: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'Alias'

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:

[RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'Alias'] CallSite.Target(Closure , CallSite , Object ) +280 System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +662 CallSite.Target(Closure , CallSite , Object ) +240 umbraco.cms.businesslogic.propertytype.PropertyType..ctor(Int32 id) +2405


Sebastiaan Janssen 28 Feb 2017, 10:52:43

@KevinJump That is fixed for 7.5.11 to be released next week: http://issues.umbraco.org/issue/U4-9560


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Easy

Category:

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.5.8

Due in version: 7.5.10

Sprint: Sprint 52

Story Points:

Cycle: