AI OnAI Off
On further debug I am having this issue while creating FilteredSectionBlock
[InvalidCastException: Unable to cast object of type 'System.String' to type 'NRL.Web.Business.Models.Properties.Tag'.] Castle.Proxies.FilteredSectionBlockProxy.get_Competition() +155 [TargetInvocationException: Property accessor 'Competition' on object 'Castle.Proxies.FilteredSectionBlockProxy' threw the following exception:'Unable to cast object of type 'System.String' to type 'NRL.Web.Business.Models.Properties.Tag'.'] System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) +378 EPiServer.Validation.DataAnnotationsValidator`1.ValidateInstance(Object instance, List`1 validationResult, ValidationContext validationContext) +456 EPiServer.Validation.DataAnnotationsValidator`1.Validate(T instance) +117 EPiServer.Validation.Internal.ContextValidatorWrapper`2.Validate(Object instance, Object context) +249 EPiServer.Validation.Internal.ValidationService.ValidateRecursively(Object instance, Object context, HashSet`1 visitedInstances) +307 EPiServer.Validation.Internal.ValidationService.Validate(Object instance, T context) +54 EPiServer.Core.ContentProvider.Validate(IContent content, ContentSaveValidationContext saveValidationContext) +215 EPiServer.Core.Internal.DefaultContentRepository.Save(IContent content, SaveAction action, AccessLevel access) +662 EPiServer.Cms.Shell.Service.Internal.ContentService.Save(IContent content, SaveAction saveAction, AccessLevel accessLevel) +55 EPiServer.Cms.Shell.Service.Internal.ContentService.Save(IContent content, SaveAction saveAction) +18 EPiServer.Cms.Shell.UI.Rest.ContentChangeManager.CreateContent(ContentReference parentLink, Int32 contentTypeId, Nullable`1 resourceFolderId, Boolean createAsLocalAsset, String name, IDictionary`2 properties, SaveAction saveAction) +182 EPiServer.Cms.Shell.UI.Rest.ContentChangeManager.Create(ContentReference parentLink, Int32 contentTypeId, Nullable`1 resourceFolderId, Boolean createAsLocalAsset, String name, IDictionary`2 properties, Boolean autoPublish) +158 EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore.Post(PostContentModel entity) +280 lambda_method(Closure , ControllerBase , Object[] ) +104 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22 System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228 System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100 System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 EPiServer.Shell.Services.Rest.RestControllerBase.EndExecute(IAsyncResult asyncResult) +38 EPiServer.Shell.Services.Rest.RestHttpHandler.EndProcessRequest(IAsyncResult result) +28 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9772985 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Hi,
It looks like Competition property should be of type string instead of Tag, since PropertyTag must be returning a string?
public virtual Tag Competition { get; set; }
Try with this instead:
public virtual string Competition { get; set; }
BR,
Marija
Hi Marija,
Thanks for reply. I have figured out the issue and it was related to backing type registration in episerver. In Admin section the registered the type of Competition was String i updated the type to Tag and TagList for other properties and it started working.
Cheers
Ali, Murtaza
Hi,
I have class which has Custom Property Tag and Defines BackingType(PropertyTag). It works in Edit Mode in UI and converts everything alright but when i try to load it in content area i get the error. I have provided the error below. Please have a look provide me the solution.