Search Unity

[Bit Rave] Error Azure (Mobile Services) to implement on WSA & WP

Discussion in 'Windows' started by TopDevilZ, Mar 18, 2015.

  1. TopDevilZ

    TopDevilZ

    Joined:
    Mar 16, 2015
    Posts:
    8
    I try to follow the link


    After that I finish following the step from the link, I build the project to Windows Phone 8.0

    and then I got the error (Windows Phone 8.0):


    Error building Player: Exception: Failed to run reference rewriter with command "--target="Temp/StagingArea\Assembly-CSharp.dll" --framework="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0,C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Libraries,D:\Unity\Editor\Data\PlaybackEngines\WP8Support\Players\ARM\master" --platform="C:\Program Files (x86)\Windows Phone Kits\8.0\Windows MetaData\Windows.winmd" --support="Temp\StagingArea\WinRTLegacy.dll" --supportpartialns=Unity.Partial --winmdrefs="" --system=System --dbg=pdb --alt=System.Net;System.Net.Sockets,System.Net;System.Xml.Serialization;System.ComponentModel,System.Windows;System.Threading,mscorlib". [Temp/StagingArea\Assembly-CSharp.dll]
    Catastrophic failure while running rrw: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'RestSharp.WindowsPhone, Version=104.4.0.0, Culture=neutral, PublicKeyToken=null'
    at Unity.ReferenceRewriter.RewriteContext.RewriteResolver.Resolve(AssemblyNameReference name)
    at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
    at Unity.ReferenceRewriter.RewriteTypeReferences.Visit(TypeReference type, String referencingEntityName)
    at Unity.ReferenceRewriter.ReferenceDispatcher.Visit(MethodReference method, String referencingEntityName)
    at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethodBody(MethodBody body)
    at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethod(MethodDefinition method)
    at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethods(TypeDefinition type)
    at Unity.ReferenceRewriter.ReferenceDispatcher.Dispatch()
    at Unity.ReferenceRewriter.RewriteOperation.Execute(RewriteContext context)
    at Unity.ReferenceRewriter.Program.Main(String[] args)

    ==============================================================================

    Could you please suggest me how to fix both error ?

    In the same time, I switch the platform to Windows Store Apps 8.1

    I also build the project to Windows Store Apps 8.1 and then I got the error (Windows Store Apps 8.1):


    Error building Player: Exception: Failed to run Reference Rewriter with cmdline --target="Temp/StagingArea\Newtonsoft.Json.dll" --framework="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhoneApp\v8.1" --platform="C:\Program Files (x86)\Windows Phone Kits\8.1\References\CommonConfiguration\Neutral\Windows.winmd" --support="Temp/StagingArea\WinRTLegacy.dll" --supportpartialns=Unity.Partial --system=System --dbg=pdb --alt=System.Xml.Serialization --ignore=System.IConvertible,mscorlib.[Temp/StagingArea\Newtonsoft.Json.dll]
    Error: method `System.String System.Char::ToString(System.IFormatProvider)` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Bson.BsonWriter::WriteValue(System.Char).
    Error: type `System.DBNull` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DataTableConverter::WriteJson(Newtonsoft.Json.JsonWriter,System.Object,Newtonsoft.Json.JsonSerializer).
    Error: type `System.DBNull` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DataTableConverter::WriteJson(Newtonsoft.Json.JsonWriter,System.Object,Newtonsoft.Json.JsonSerializer).
    Error: field `System.DBNull System.DBNull::Value` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DataTableConverter::WriteJson(Newtonsoft.Json.JsonWriter,System.Object,Newtonsoft.Json.JsonSerializer).
    Error: type `System.DBNull` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DataTableConverter::CreateRow(Newtonsoft.Json.JsonReader,System.Data.DataTable).
    Error: type `System.DBNull` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DataTableConverter::CreateRow(Newtonsoft.Json.JsonReader,System.Data.DataTable).
    Error: field `System.DBNull System.DBNull::Value` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DataTableConverter::CreateRow(Newtonsoft.Json.JsonReader,System.Data.DataTable).
    Error: method `System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags)` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DiscriminatedUnionConverter::EnsureInitialized(System.Type).
    Error: method `System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags)` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DiscriminatedUnionConverter::EnsureInitialized(System.Type).
    Error: method `System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags)` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DiscriminatedUnionConverter::EnsureInitialized(System.Type).
    Error: method `System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags)` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Converters.DiscriminatedUnionConverter::EnsureInitialized(System.Type).
    Error: type `System.Runtime.Serialization.SerializationInfo` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.JsonException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Error: type `System.Runtime.Serialization.SerializationInfo` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.JsonException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Error: method `System.Void System.Exception::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.JsonException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Error: type `System.Threading.Thread` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Collections.Generic.IEnumerator`1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::System.Collections.Generic.IEnumerable<Newtonsoft.Json.Linq.JToken>.GetEnumerator().
    Error: type `System.Threading.Thread` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Collections.Generic.IEnumerator`1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::System.Collections.Generic.IEnumerable<Newtonsoft.Json.Linq.JToken>.GetEnumerator().
    Error: method `System.Threading.Thread System.Threading.Thread::get_CurrentThread()` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Collections.Generic.IEnumerator`1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::System.Collections.Generic.IEnumerable<Newtonsoft.Json.Linq.JToken>.GetEnumerator().
    Error: type `System.Threading.Thread` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Collections.Generic.IEnumerator`1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::System.Collections.Generic.IEnumerable<Newtonsoft.Json.Linq.JToken>.GetEnumerator().
    Error: method `System.Int32 System.Threading.Thread::get_ManagedThreadId()` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Collections.Generic.IEnumerator`1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::System.Collections.Generic.IEnumerable<Newtonsoft.Json.Linq.JToken>.GetEnumerator().
    Error: type `System.Threading.Thread` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::.ctor(System.Int32).
    Error: type `System.Threading.Thread` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::.ctor(System.Int32).
    Error: method `System.Threading.Thread System.Threading.Thread::get_CurrentThread()` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::.ctor(System.Int32).
    Error: type `System.Threading.Thread` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.Linq.JsonPath.ArrayIndexFilter/<ExecuteFilter>d__0::.ctor(System.Int32)....
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    For Windows Phone 8, it says, it can't locate 'RestSharp.WindowsPhone, Version=104.4.0.0, Culture=neutral, PublicKeyToken=null'

    As for Windows Store Apps, it seems Newtonsoft.Json.dll is not comptabile, it more looks like a desktop assembly, you'll need to get Newtonsoft.Json.dll specifically compiled for Windows Store Apps.
     
  3. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Did you download the JSON.NET Unity package?

    If so, your problem might be caused by an old version of RestSharp.

    I would suggest cloning the latest version of RestSharp from https://github.com/restsharp/RestSharp.git
    And doing a build for WSA and WP8 and put the new DLL's in the relevant locations.
     
  4. TopDevilZ

    TopDevilZ

    Joined:
    Mar 16, 2015
    Posts:
    8
    Thank you very much for your reply. I can fix the error of RestSharp by doing this.



    Now I think I just got the same error like Problem's Windows Store Apps 8.1
    but I have had the file
    I am not sure about "Did you download the JSON.NET Unity package?"
    It means I must down l

    Error building Player: Exception: Failed to run reference rewriter with command "--target="Temp/StagingArea\Newtonsoft.Json.dll" --framework="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0,C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Libraries,D:\Unity\Editor\Data\PlaybackEngines\WP8Support\Players\ARM\master" --platform="C:\Program Files (x86)\Windows Phone Kits\8.0\Windows MetaData\Windows.winmd" --support="Temp\StagingArea\WinRTLegacy.dll" --supportpartialns=Unity.Partial --winmdrefs="" --system=System --dbg=pdb --alt=System.Net;System.Net.Sockets,System.Net;System.Xml.Serialization;System.ComponentModel,System.Windows;System.Threading,mscorlib". [Temp/StagingArea\Newtonsoft.Json.dll]
    Error: type `System.Runtime.Serialization.SerializationInfo` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.JsonException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Error: type `System.Runtime.Serialization.SerializationInfo` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void Newtonsoft.Json.JsonException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext).
    Error: method `System.Void System.Exception::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)` doesn't exist in target framework. It is referenced from Newtonsoft.Json.dll at System.Void...
     
  5. TopDevilZ

    TopDevilZ

    Joined:
    Mar 16, 2015
    Posts:
    8
    As for Windows Store Apps, it seems Newtonsoft.Json.dll is not comptabile, it more looks like a desktop assembly, you'll need to get Newtonsoft.Json.dll specifically compiled for Windows Store Apps.

    Could you please suggest me how to download that file?
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Where did you got your original Newtonsoft.Json.dll?