title: How to use Windows Runtime classes in .NET Core libraries?
body: <p>I'm developing a library for use with WPF and Windows 10. I'm running into issues getting it to compile on the latter. Here is some of the code:</p>
  
  <p><strong>project.json</strong></p>
  
  <pre><code>{
      "frameworks": {
          "net46": {
              "frameworkAssemblies": {
                  "WindowsBase": "4.0.0.0"
              }
          },
          "netcore50": {
              "dependencies": {
                  "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
              }
          }
      }
  }
  </code></pre>
  
  <p><strong>Dependency.cs</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  #if NET46
  using System.Windows; // .NET Framework 4.6
  #elif NETCORE50
  using Windows.UI.Xaml; // Windows 10 apps
  #endif
  
  public static class Dependency
  {
      public static DependencyProperty Register&lt;T, TOwner&gt;(string name, PropertyChangedCallback&lt;T, TOwner&gt; callback)
          where TOwner : DependencyObject
      {
          // Code here....
      }
  }
  </code></pre>
  
  <p>While this compiles fine for <code>net46</code> (which is the traditional .NET Framework), I'm having trouble getting it to work for <code>netcore50</code> (which can be used by Windows 10 apps). For some reason, it looks like types like <code>DependencyProperty</code> or <code>DependencyObject</code> are not included in that configuration.</p>
  
  <p>Is there a <code>netcore50</code>-compatible NuGet package I can install that contains these types, so I can use them from my library?</p>
  
  <p>Thanks for helping.</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> I just typed in <code>DependencyProperty</code> in VS and hit F12. It appears that the type lives in the <strong>Windows.Foundation.UniversalApiContract</strong> assembly, but there's no such package on NuGet.</p>