UWP Build Failure - AssemblyResolutionException: Failed to resolve assembly: WinRTLegacy

Hello experts,

I am trying to make a build targetting UWP. After overcoming a whole bunch issues, I got stuck and nothing on the forums nor Google could help out. It seems that the compiler cannot find WinRTLegacy.dll (although it is right where it should be). Build Error

AssemblyResolutionException: Failed to resolve assembly: ‘WinRTLegacy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’
Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters)
UnityEditor.MonoAssemblyStripping.ResolveAssemblyReference (IAssemblyResolver resolver, Mono.Cecil.AssemblyNameReference assemblyName) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/MonoAssemblyStripping.cs:264)
UnityEditor.HostView:OnGUI()

If I manually bring the dll in the project, I get the duplicate error for the “SerializableAttribute”:
Duplicate error error CS0433: The type ‘SerializableAttribute’ exists in both ‘WinRTLegacy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ and ‘mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’

I am building on Unity 2017.1.0f3 with the following player settings:
3195048--244067--PlayerSettings1.PNG

3195048--244068--PlayerSettings2.PNG

How can I solve this issue in order to build for UWP?

Thank you,
Alex.

Do you know what is referencing WinRTLegacy.dll? It is specific to .NET scripting backend and doesn’t exist on IL2CPP.

Unfortunately no, we don’t know what is referencing WinRTLegacy.dll. The only error is the AssemblyResolutionException, nothing else. Could you please suggest a way for us to find out where the referencing comes from?

Thank you,
Alex.

Yes. After a failed build, you should find a folder called “Managed” somewhere under “Temp” folder in your project. You can use a program like ILSpy to crack open those DLLs see what they’re referencing.

We found the culprit; it was an asset that needed to be updated. Thank you very much for your support!

Cheers,
Alex.

Do you mind naming that asset so that people who run into this in the future that find this post have an easier time?

Oh, yes, of course! It was PlayMaker, but after upgrading to the latest release, the problem was solved.

Thanks again and sorry for the delayed response.