title: C# UWP Build failed / Windows.Foundation.FoundationContract missing
body: <p>I updated one UWP App to a newer SDK and set target version to 16299 and Min Version to 15063. </p>
  
  <p>Then I'm using the Windows.Foundation.UniversalApiContract Namespace to use features of the new SDK if available. Example:</p>
  
  <pre><code>xmlns:contract5NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,5)"
  xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
  
  &lt;contract5Present:NavigationView x:Name="NavView" ...
  </code></pre>
  
  <p>The build failed with no error message displayed. But when I set build log to detailed it seems that it won't find the assemblies:</p>
  
  <pre><code>Could not resolve this reference. Could not locate the assembly "Windows.Foundation.FoundationContract, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
  </code></pre>
  
  <blockquote>
    <p>The Folder and files exist on C:\Program Files (x86)\Windows
    Kits\10\References**10.0.16299.0**\Windows.Foundation.FoundationContract\3.0.0.0
    AND C:\Program Files (x86)\Windows
    Kits\10\References**10.0.15063.0**\Windows.Foundation.FoundationContract\3.0.0.0</p>
  </blockquote>
  
  <p>Update 1:
  It seems it has to to with my resource disctionary and the acrylic brushes. If I copy my resource dictionary to a blank app the same error occurs. If I remove the contract thing and all acrylic brushes from the resource disctionary the build succeeded. So what am I missing here?</p>
  
  <p>Update 2:
  I finally found where the issue occurs (maybe you can reproduce, just start with an blank app (Target: Fall Creators, Min Version: Creators Update), create a ResourceDictionary and copy this into it):</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:local="using:App6"
                  xmlns:contract5NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,5)"
                  xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
                  &gt;
  
  &lt;Thickness x:Key="HeaderMargin"&gt;20,41,0,0&lt;/Thickness&gt;
  
  &lt;ResourceDictionary.ThemeDictionaries&gt;
      &lt;ResourceDictionary x:Key="Light"&gt;
          &lt;Color x:Key="BrandColor"&gt;#D1D1D1&lt;/Color&gt;
          &lt;contract5Present:AcrylicBrush x:Key="OptionsPaneBackground" BackgroundSource="Backdrop" TintColor="{StaticResource BrandColor}" TintOpacity="0.2" FallbackColor="#D1D1D1" /&gt;
      &lt;/ResourceDictionary&gt;
  
      &lt;ResourceDictionary x:Key="Dark"&gt;
          &lt;Color x:Key="BrandColor"&gt;#3F3F46&lt;/Color&gt;
          &lt;contract5Present:AcrylicBrush x:Key="OptionsPaneBackground" BackgroundSource="Backdrop" TintColor="{StaticResource BrandColor}" TintOpacity="0.6" FallbackColor="#3F3F46" /&gt;
      &lt;/ResourceDictionary&gt;
  
  &lt;/ResourceDictionary.ThemeDictionaries&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>If I remove the first line (thickness) from the dictionary the Build succeed. My system runs on <strong>April 2018 Update</strong>, but I have the same issue on another machine with the <strong>Fall Creators Update</strong>.</p>
  
  <p><strong>Solution</strong>: I've splitted ThemeResources and Styles into two seperate ResourceDictionaries and now the build succeeded in my main project. But I do not understand why this is happening and why no exact error message appears. I've spent about 8 hours (my project has >70000 lines of code) to find the issue and I'm a little bit angry about it :)</p>