- Home /
Error building with custom plugin: Failed to run reference rewriter
I have put together a custom plugin following the instructions exactly in the documentation for Windows Phone 8.
Everything runs in the editor but when I go to build for Windows 8.1 phone I get this error listed below.
Some details: - I set my Fake Plugin DLL in the Plugins folder to platform = Editor - I set the Real Plugin DLL in the Plugins/WSA folder to platform = WSAPlyaer - My Fake Plugin DLL targets .NET 3.5 (using C#) - My Real Plugin DLL targets Windows Phone 8.1 (using C#)
Does anyone know how to fix this?
Build error:
UnityException: Failed to run reference rewriter with command --target="Temp\StagingArea\WP8Plugin.dll" --additionalreferences="Temp\StagingArea" --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 --framework="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhoneApp\v8.1" --alt=System.Xml.Serialization --ignore=System.IConvertible,mscorlib. Catastrophic failure while running rrw: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.Phone, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e' at Unity.SearchPathAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters) at Unity.SearchPathAssemblyResolver.Resolve(AssemblyNameReference name) at Mono.Cecil.MetadataResolver.Resolve(TypeReference type) at Mono.Cecil.TypeReference.Resolve() at Unity.ReferenceRewriter.RewriteTypeReferences.Visit(TypeReference type, String referencingEntityName) at Unity.ReferenceRewriter.ReferenceDispatcher.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.RewriteTypeReferences.Run() at Unity.ReferenceRewriter.RewriteOperation.Execute(RewriteContext context) at Unity.ReferenceRewriter.Program.Main(String[] args)
PostProcessWinRT.RunReferenceRewriter () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:566) PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:123) UnityEditor.Metro.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:133) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316) UnityEditor.HostView:OnGUI()
Answer by AtticusMarkane · Aug 17, 2016 at 05:14 PM
I'm guessing you moved past this but if not you might want to check out this doc: https://docs.unity3d.com/Manual/windowsstore-missingtypes.html
I was getting similar errors when I building against NetCore
Answer by sami1592 · Oct 18, 2018 at 12:43 PM
I am working with an example from Microsoft which deals with running WebRtc on Universal Windows Platform, more specifically the Peer-CC example (https://github.com/Microsoft/WebRTC-universal-samples/tree/master/Samples/PeerCC-Sample)
For me, the project was missing some .dll
(more specifically Org.webRtc.dll
). I copied the .dll
but not the associated .winmd
file.
That was causing this error and was solved after coping the .winmd
file.