Copied to clipboard

Flag this post as spam?

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


  • Joshua D. Stewart 34 posts 84 karma points
    Mar 10, 2015 @ 17:33
    Joshua D. Stewart
    0

    Error: Failed to retrieve languages when creating datatype

    I'm getting the following error when I try to create a Vorto datatype when using the installed languages option : Failed to retrieve languages.

    The javascript console shows the following error:

    )]}',
    {"Message":"An error has occurred.","ExceptionMessage":"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.","ExceptionType":"System.InvalidOperationException","StackTrace":null,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Error while copying content to a stream.","ExceptionType":"System.Net.Http.HttpRequestException","StackTrace":null,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)","ExceptionType":"System.IO.FileLoadException","StackTrace":"   at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)\r\n   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)\r\n   at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)\r\n   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)\r\n   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)\r\n   at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)\r\n   at System.Reflection.CustomAttribute.IsDefined(RuntimePropertyInfo property, RuntimeType caType)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.GetSerializableMembers(Type objectType)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperties(Type type, MemberSerialization memberSerialization)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.WriteStartArray(JsonWriter writer, Object values, JsonArrayContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IWrappedCollection values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value)\r\n   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value)\r\n   at System.Net.Http.Formatting.JsonMediaTypeFormatter.<>c__DisplayClassd.<WriteToStreamAsync>b__c()\r\n   at System.Threading.Tasks.TaskHelpers.RunSynchronously(Action action, CancellationToken token)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Umbraco.Web.WebApi.AngularJsonMediaTypeFormatter.<WriteToStreamAsync>d__0.MoveNext()"}}}

    The site is running on Umbraco 7.0.4.

    Thanks in advance for any help you can provide.

  • Joshua D. Stewart 34 posts 84 karma points
    Mar 10, 2015 @ 17:50
    Joshua D. Stewart
    100

    After seeing the full text above I realized the problem. For anyone experiencing the same issue you'll need to add the block below in the runtime / assembly binding section at the bottom of the web.config. It appears that vorto is expecting the 6.0.0.0 version of Newtonsoft.Json. Umbraco 7.0.4 is using 4.5.0.0

    <dependentAssembly><assemblyIdentityname="Newtonsoft.Json"publicKeyToken="30ad4fe6b2a6aeed"culture="neutral"/><bindingRedirectoldVersion="0.0.0.0-6.0.0.0"newVersion="4.5.0.0"/></dependentAssembly>

     

Please Sign in or register to post replies

Write your reply to:

Draft