- Home /
Unity 4.3 error when I do build (windows phone).
Hi, I try to do a build in windows phone with unity 4.3, I did it in unity 4.2.2 and unity builded the visual studio project, but Now shows me next error and can't build visual studio project. What can I do?
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" --platform="C:\Program Files (x86)\Windows Phone Kits\8.0\Windows MetaData\Windows.winmd" --support="Temp/StagingArea/WinRTLegacy.dll" --winmdrefs="" --system=Unity --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: System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source) at Unity.ReferenceRewriter.RewriteTypeReferences.RewriteObjectListToParamsCall(MethodBody methodBody, Int32 instructionIndex) 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)
Reference rewriter: Error: type WinRTLegacy.Text.Encoding doesn't exist in target framework. It is referenced from App42-Unity3D-SD$$anonymous$$-WinRT-4.0.1.dll at System.String com.shephertz.app42.paas.sdk.csharp.util.Base64::EncodeTo64(System.String). UnityEngine.Debug:LogError(Object) PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:581) PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:126) UnityEditor.HostView:OnGUI()
Reference rewriter: Error: type System.Collections.Specialized.IOrderedDictionary doesn't exist in target framework. It is referenced from App42-Unity3D-SD$$anonymous$$-WinRT-4.0.1.dll at App42Json.IJsonWrapper. UnityEngine.Debug:LogError(Object) PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:581) PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:126) UnityEditor.HostView:OnGUI()
Reference rewriter: Error: type System.IO.File$$anonymous$$ode doesn't exist in target framework. It is referenced from App42-Unity3D-SD$$anonymous$$-WinRT-4.0.1.dll at System.Void com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorWWW::Execute$$anonymous$$ultipart(System.String,System.String,System.Collections.Generic.Dictionary`2 ,System.Collections.Generic.Dictionary`2,System.Collections.Generic.Dictionary`2 ,System.Collections.Generic.Dictionary`2,System.String,System.String,com.shephertz.app42.paas.sdk.csharp.App42CallBack). UnityEngine.Debug:LogError(Object) PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:581) PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:126) UnityEditor.HostView:OnGUI()
unity version 5.4.2
Answer by MasterChris · Nov 15, 2013 at 12:53 AM
I had this same issue. This is a bug in Unity related to WINRT legacy code. Here was my post: link text
Your answer
![](https://koobas.hobune.stream/wayback/20220613121724im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Missing Windows Phone solution class documentation 0 Answers
Aim Down Sight Script not working with GUI Button, but working with MouseButtonDown(0) 1 Answer
game stopd and quits as the terrain loads in winPhone 8.1 0 Answers
Control camera through Windows Phone accelerometer 0 Answers
Windows Phone 8 Build 3 Answers