Copied to clipboard

Flag this post as spam?

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


  • Joel Hansen 38 posts 96 karma points
    Jun 02, 2016 @ 12:20
    Joel Hansen
    0

    Umbraco 7.2.1 backend broken after installing Linked Content Data Type.

    This package seemed promising for a particular need I have at a customer's website, but the backend crashed when your .dll was installed.

    The backend was unable to lazyload a resource. The server returned a YSOD with an error 500, unable to load System.Web.Mvc. (Removing your .dll solved the problem.) This resulted in the browser showing nothing

    I'm glad I didn't attempt this on their live-site, but tried it first on my localhost :)

  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Jun 02, 2016 @ 12:44
    Jeremy Pyne
    0

    I posted a fixed dll when browsing the document type and media type trees. The error you are having look like it is unrelated though. This is bound to Mvc 5.2.3 but Umbraco 7.2 uses Mvc 4. It may be possible to get it to load properly by updating the Mvc binding redirect in the web.config but I haven't tested it.

      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    
  • Joel Hansen 38 posts 96 karma points
    Jun 02, 2016 @ 13:52
    Joel Hansen
    0

    Thank you for your quick reply!

    Your suggestion got us a little closer, but not quite there yet. The Umbraco backend is not entirely broken anymore. I was able to create the data type and add it to my document type.

    However, when I open a document with the Linked Content data type, I get the following error:

    Received an error from the server
    Failed to retrieve data
    
    Could not load file or assembly 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    
    EXCEPTION DETAILS:
    
    System.IO.FileLoadException: Could not load file or assembly 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    STACKTRACE:
    
    at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
       at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
       at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
       at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.InitializeProperties(MethodInfo methodInfo)
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor..ctor(HttpControllerDescriptor controllerDescriptor, MethodInfo methodInfo)
       at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem..ctor(HttpControllerDescriptor controllerDescriptor)
       at System.Web.Http.Controllers.ApiControllerActionSelector.<>c__DisplayClass2.<GetInternalSelector>b__0(Object _)
       at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
       at System.Web.Http.Controllers.ApiControllerActionSelector.GetInternalSelector(HttpControllerDescriptor controllerDescriptor)
       at System.Web.Http.Controllers.ApiControllerActionSelector.SelectAction(HttpControllerContext controllerContext)
       at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
       at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsyncInternal(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    

    Have any good ideas as to how to solve this?

  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Jun 02, 2016 @ 13:58
    Jeremy Pyne
    0

    You can make the same change indicated for the System.Web.Mvc binding to the System.Web.Http one, and possibly System.Net.Http.Formatting as well in the web.config.

    What this configs change is doing is telling the system to just use the v4 assemblies when some dll tries to load v5.2.3.

    Ie:

      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    
  • Joel Hansen 38 posts 96 karma points
    Jun 02, 2016 @ 14:04
    Joel Hansen
    0

    Thank you again. That led me to another error :)

    Received an error from the server
    Failed to retrieve data
    
    Method not found: 'Void System.Web.Http.AcceptVerbsAttribute..ctor(System.String)'.
    
    EXCEPTION DETAILS:
    
    System.MissingMethodException: Method not found: 'Void System.Web.Http.AcceptVerbsAttribute..ctor(System.String)'.
    STACKTRACE:
    
    at System.ModuleHandle.ResolveMethod(RuntimeModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
       at System.ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, Int32 methodToken, IntPtr[] typeInstantiationContext, Int32 typeInstCount, IntPtr[] methodInstantiationContext, Int32 methodInstCount)
       at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
       at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.InitializeProperties(MethodInfo methodInfo)
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor..ctor(HttpControllerDescriptor controllerDescriptor, MethodInfo methodInfo)
       at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem..ctor(HttpControllerDescriptor controllerDescriptor)
       at System.Web.Http.Controllers.ApiControllerActionSelector.<>c__DisplayClass2.<GetInternalSelector>b__0(Object _)
       at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
       at System.Web.Http.Controllers.ApiControllerActionSelector.GetInternalSelector(HttpControllerDescriptor controllerDescriptor)
       at System.Web.Http.Controllers.ApiControllerActionSelector.SelectAction(HttpControllerContext controllerContext)
       at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
       at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsyncInternal(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    

    I'm sorry for the trouble, hope you know how to deal with this one too.

  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Jun 02, 2016 @ 14:07
    Jeremy Pyne
    0

    Yah, its not going to work then, It's trying to use code from Mvc5 witch isn't available until Umbraco 7.3.

  • Joel Hansen 38 posts 96 karma points
    Jun 02, 2016 @ 14:09
    Joel Hansen
    0

    All right, that is too bad. Thank you for trying anyway.

    Would you be willing to share your source code? Then I could at least make my own 7.2.x compatible build.

  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Jun 02, 2016 @ 14:10
    Jeremy Pyne
    0

    I'll build the package against 7.2. It may work without needing customizations.

  • Joel Hansen 38 posts 96 karma points
    Jun 02, 2016 @ 14:11
    Joel Hansen
    0

    That's even better, thanks a lot! Looking forward to it.

  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Jun 02, 2016 @ 14:46
    Jeremy Pyne
    0

    This version should work in 7.2 and won't need the binding redirects.

    https://our.umbraco.org/FileDownload?id=16276

    I don't have 7.2 installed so I didn't actually test it though :P

  • Joel Hansen 38 posts 96 karma points
    Jun 02, 2016 @ 15:00
    Joel Hansen
    0

    That's awesome. It runs on my localhost 7.2.1, without any changes to the web.config.

    However, a new issue appeared.

    I'm getting the following error, when I click the "Show Items"-button.

    Received an error from the server
    Failed to retrieve data
    
    The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.
    
    EXCEPTION DETAILS:
    
    System.InvalidOperationException: The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.
    STACKTRACE:
    
  • Jeremy Pyne 106 posts 246 karma points MVP c-trib
    Jun 02, 2016 @ 17:10
    Jeremy Pyne
    0

    I posted a new version of this package for Umbraco 7.2.

    https://our.umbraco.org/FileDownload?id=16277

    I have tested this with a clean 7.2 install and it works fine so it should work on any patch release.

    This also adds basic support for content in Grid properties.

  • Joel Hansen 38 posts 96 karma points
    Jun 02, 2016 @ 18:28
    Joel Hansen
    1

    It works perfectly, thank you so much!

Please Sign in or register to post replies

Write your reply to:

Draft