# Build Errors using UnityLinker

**URL:** https://discussions.unity.com/t/build-errors-using-unitylinker/885818
**Category:** C# & .NET
**Tags:** Bug
**Created:** [June 23, 2022, 7:58pm UTC](https://discussions.unity.com/t/build-errors-using-unitylinker/885818 "2022-06-23T19:58:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Emmanuel\_Plante](https://avatars.discourse-cdn.com/v4/letter/e/7c8e57/32.png) [@Emmanuel\_Plante](https://discussions.unity.com/u/Emmanuel_Plante)
#### Post date: [June 23, 2022, 7:58pm UTC](https://discussions.unity.com/t/build-errors-using-unitylinker/885818/1 "2022-06-23T19:58:25Z")

</div>

Hello all,

Currently getting some error from the unity build.

Unity version 2019.1  
Using the .Net 4.x compatibility  
Building for Hololens  
Building UWP

The exception is the following (See full stack trace below):

Failed running D:\Program Files\Unity\Hub\Editor\2019.3.5f1\Editor\Data\il2cpp\build/deploy/net471/UnityLinker.exe

Fatal error in Unity CIL Linker

Mono.Linker.Steps.XmlResolutionException: Failed to process XML description: D:\Users\<username\>\AppData\Local\Temp\tmp163e9c39.tmp —\> System.NullReferenceException: Object reference not set to an instance of an object.  
at Mono.Cecil.WindowsRuntimeProjections.CollectImplementedInterfaces(TypeReference type, HashSet`1 results)  
…

This Error seems to be caused by the Microsoft.MixedReality.Toolkit.SDK because every time we remove it from the .tmp file (which is a Linker file) the error moves on to another file, where that dependency is also in.

We have followed the instructions and added the link.xml from the Microsoft page but the error persists

Any help would be greatly appreciated. our project is just to say done and working on unity but cannot be built.

Thanks!

here is the full stack trace:

Failed running D:\Program Files\Unity\Hub\Editor\2019.3.5f1\Editor\Data\il2cpp\build/deploy/net471/UnityLinker.exe -out=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/tempStrip” -x=D:/Users//AppData/Local/Temp/tmp163e9c39.tmp -x=D:/Users//AppData/Local/Temp/tmp747a75ba.tmp -x=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/TypesInScenes.xml” -x=“D://\<path\_to\_project\>/Assets/Lib/link.xml” -d=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.SceneSystem.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Async.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Providers.WindowsVoiceInput.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Gltf.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Providers.XRSDK.WindowsMixedReality.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality.Shared.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.SpatialAwarenessSystem.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.CameraSystem.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.SDK.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.TeleportSystem.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.DiagnosticsSystem.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.InputSystem.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Siccity.GLTFUtility.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.InputAnimation.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Providers.XRSDK.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.BoundarySystem.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Dracodec.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/Microsoft.MixedReality.Toolkit.Services.InputSimulation.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/I18N.CJK.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/I18N.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/I18N.MidEast.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/I18N.Other.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/I18N.Rare.dll” --include-unity-root-assembly=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/I18N.West.dll” --dotnetruntime=il2cpp --dotnetprofile=unityaot --use-editor-options --include-directory=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed” --rule-set=Conservative --editor-data-file=“D://\<path\_to\_project\>/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json” --platform=WinRT --engine-modules-asset-file=“D:/Program Files/Unity/Hub/Editor/2019.3.5f1/Editor/Data/PlaybackEngines/MetroSupport/Whitelists/…/modules.asset”

stdout:

Fatal error in Unity CIL Linker

Mono.Linker.Steps.XmlResolutionException: Failed to process XML description: D:\Users\<username\>\AppData\Local\Temp\tmp163e9c39.tmp —\> System.NullReferenceException: Object reference not set to an instance of an object.  
at Mono.Cecil.WindowsRuntimeProjections.CollectImplementedInterfaces(TypeReference type, HashSet`1 results) at Mono.Cecil.WindowsRuntimeProjections.GenerateRedirectionInformation(TypeDefinition type, Collection`1& redirectedMethods, Collection`1& redirectedInterfaces) at Mono.Cecil.WindowsRuntimeProjections.Project(TypeDefinition type) at Mono.Cecil.MetadataReader.InitializeTypeDefinitions() at Mono.Cecil.MetadataReader.ReadTypes() at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)  
at Mono.Cecil.ModuleDefinition.get\_Types()  
at Mono.Cecil.ModuleDefinition.GetType(String namespace, String name)  
at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.GetType(ModuleDefinition module, TypeReference reference)  
at Unity.IL2CPP.Common.WindowsRuntimeAwareMetadataResolver.FindTypeInUnknownWinmd(TypeReference type)  
at Mono.Cecil.TypeReference.Resolve()  
at Unity.IL2CPP.Common.AssemblyDependenciesComponent.ResolveWindowsRuntimeReferences(AssemblyDefinition assembly)  
at Unity.IL2CPP.Common.AssemblyDependenciesComponent.CollectAssemblyDependencies(AssemblyDefinition assembly)  
at Unity.IL2CPP.Common.AssemblyDependenciesComponent.GetReferencedAssembliesFor(AssemblyDefinition assembly)  
at Unity.Linker.UnityLinkContext.ResolveReferences(AssemblyDefinition assembly)  
at Unity.Linker.Steps.Resolution.UnityResolveFromXmlStep.ProcessAssemblies(LinkContext context, XPathNodeIterator iterator)  
at Mono.Linker.Steps.ResolveFromXmlStep.Process()  
— End of inner exception stack trace —  
at Mono.Linker.Steps.ResolveFromXmlStep.Process()  
at Mono.Linker.Steps.BaseStep.Process(LinkContext context)  
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)  
at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)  
at Mono.Linker.Pipeline.Process(LinkContext context)  
at Unity.Linker.UnityDriver.Run()  
at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling()  
at Unity.Linker.UnityDriver.RunDriver()

---

<div class="post-metadata">

### Author: ![Emmanuel\_Plante](https://avatars.discourse-cdn.com/v4/letter/e/7c8e57/32.png) [@Emmanuel\_Plante](https://discussions.unity.com/u/Emmanuel_Plante)
#### Post date: [June 28, 2022, 2:31pm UTC](https://discussions.unity.com/t/build-errors-using-unitylinker/885818/2 "2022-06-28T14:31:35Z")

</div>

Anybody has an Idea why the MRTK gives me null reference errors when trying to build in unity??? Any work arounds?
