title: UWP - Object reference not set to an instance of an object
body: <p>After upgrading <code>Microsoft.NETCore.UniversalWindowsPlatform</code> I cannot compile my Xamarin app-project in Release anymore, as I get an <code>Internal compiler error: Object reference not set to an instance of an object</code>.</p>
  
  <p>I am using these NuGet packages</p>
  
  <pre><code>Acr.UserDialogs   5.2.2
  ExifLib.PCL   1.0.1   (in portable project)
  Microsoft.NETCore.UniversalWindowsPlatform   5.2.0
  MR.Gestures   1.3.4
  Newtonsoft.Json   7.0.1   (in portable project)
  Splat   1.6.2   (in portable project)
  SQLite.Net.Core-PCL   3.1.1
  SQLite.Net-PCL   3.1.1
  Win2D.uwp   1.18.0   (in portable project)
  Xam.Plugins.Settings   2.1.0
  Xamarin.Forms   2.3.0.107
  Xamarin.Insights   1.12.3
  XLabs.Core   2.2.0-pre02
  XLabs.Forms   2.2.0-pre02
  XLabs.IoC   2.2.0-pre02
  XLabs.Platform   2.2.0-pre02
  XLabs.Serialization   2.2.0-pre02
  </code></pre>
  
  <p>A log can be found <a href="https://www.dropbox.com/s/fnod4quq5xopwye/Xamarin%20log.txt?dl=0" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I hope anybody in here can help me.</p>
  
  <p>All platforms are set to <code>Compile with .NET Native tool chain</code>.</p>
  
  <p><strong>UPDATE</strong><br />
  If I build <code>XLabs</code> myself and set <code>Compile with .NET Native tool chain</code> to unchecked. These errors occurs.</p>
  
  <p><strong>App manifest</strong><br />
  Error Found: The app manifest test detected the following errors:
  <code>&lt;project&gt; takes a dependency on Microsoft .Net Native Runtime Package 1.x framework but is missing the framework dependency declaration in the manifest.</code></p>
  
  <p><strong>Binary analyzer</strong><br />
  Error Found: The binary analyzer test detected the following errors:
  <code>File C:\Program Files\WindowsApps\&lt;project&gt;_1.8.0.0_x64__r1myykanma94r\clrjit.dll has failed the AppContainerCheck check.</code></p>
  
  <p><strong>Supported APIs</strong><br />
  Error Found: The supported APIs test detected the following errors:</p>
  
  <pre><code>API SystemFunction036 in advapi32.dll is not supported for this application type. clrjit.dll calls this API.
  API DebugBreak in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API HeapValidate in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API LoadLibraryExW in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API RtlCaptureContext in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API RtlVirtualUnwind in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API TlsAlloc in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API TlsFree in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API TlsGetValue in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API TlsSetValue in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API UnhandledExceptionFilter in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API VirtualAlloc in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API VirtualProtect in kernel32.dll is not supported for this application type. clrjit.dll calls this API.
  API ExecuteAssembly in uwphost.dll is not supported for this application type. &lt;project&gt;.exe calls this API.
  API DllGetActivationFactory in uwphost.dll is not supported for this application type. &lt;project&gt;.UWP.exe has an export that forwards to this API.
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I could easily rewrite the code, so I did not use <code>Win2D.uwp</code> anymore. Somehow I have installed <code>Microsoft.NETCore.UniversalWindowsPlatform v 5.2.0</code> last friday, but the latest in NuGet is now <code>v 5.1.0</code>.
  So now I am down to these NuGet packages</p>
  
  <pre><code>Acr.UserDialogs   5.3.0
  ExifLib.PCL   1.0.1   (in portable project)
  Microsoft.NETCore.UniversalWindowsPlatform   5.1.0
  MR.Gestures   1.3.4
  Newtonsoft.Json   7.0.1   (in portable project)
  Splat   1.6.2   (in portable project)
  SQLite.Net.Core-PCL   3.1.1
  SQLite.Net-PCL   3.1.1
  Xam.Plugins.Settings   2.1.0
  Xamarin.Forms   2.3.0.107
  Xamarin.Insights   1.12.3
  XLabs.Core   2.2.0-pre02
  XLabs.Forms   2.2.0-pre02
  XLabs.IoC   2.2.0-pre02
  XLabs.Platform   2.2.0-pre02
  XLabs.Serialization   2.2.0-pre02
  </code></pre>
  
  <p>And this error occurs <code>The assembly Windows in file C:\Program Files\WindowsApps\&lt;app-name&gt;_1.8.0.0_x64__r1myykanma94r\Windows.winmd has a non-empty exported type reference table. Every Windows Runtime assembly must have an empty exported type reference table.</code></p>
  
  <p><strong>UPDATE 3</strong><br />
  I figured out uninstalling <code>Win2D.uwp</code> and compiling <code>XLabs</code> myself was the way to go.</p>