title: Use UWP in WPF Application Throws Error "generating manifest"
body: <p>I want to use the OCR component of UWP in an WPF C# app.This is done by using a C# class library in other projects. On build I get the following error shown below. How can I get this to compile? </p>
  
  <blockquote>
    <p>Error 1 Problem generating manifest. Could not load file or assembly
    '{MyAppPath}\Windows.winmd' or one of its dependencies. Attempt to
    load a program with an incorrect format.</p>
  </blockquote>
  
  <p>The picture shows the references:</p>
  
  <p><a href="https://i.stack.imgur.com/Antgn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Antgn.png" alt="enter image description here"></a></p>
  
  <p>The files are:</p>
  
  <p>System.Runtime.WindowsRuntime: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.WindowsRuntime.dll</p>
  
  <p>System.Runtime.InteropServices.WindowsRuntime: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\Facades\System.Runtime.InteropServices.WindowsRuntime.dll</p>
  
  <p>Windows: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd</p>
  
  <p>The Code I want to use (not in a finsished state, I just want it to compile)</p>
  
  <pre><code>using System;
  using Windows.Graphics.Imaging;
  using Windows.Media.Ocr;
  using Windows.Storage;
  
  namespace tegBase
  {
      public class Scan
      {
  
          public static async void OcrAusfuehren()
          {
  
              var fileName = @"C:\a.jpg";
              StorageFile file = await StorageFile.GetFileFromPathAsync(fileName);
  
              var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
  
              var decoder = await Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(stream);
  
              SoftwareBitmap b;
              b = await decoder.GetSoftwareBitmapAsync();
  
              OcrEngine ocrEngine = OcrEngine.TryCreateFromUserProfileLanguages();
              var s = await ocrEngine.RecognizeAsync(b);
              Windows.Media.Ocr.OcrResult c = s;
              Console.WriteLine(c.Text);
  
          }
      }
  }
  </code></pre>
  
  <p>Update: </p>
  
  <p>I tried to reproduce the error on another PC, there however, the UnionMetadata folder is empty. So I took the winmd from 10.0.16299.0, but it lead to the same result.</p>
  
  <p><a href="https://i.stack.imgur.com/zJU0d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zJU0d.png" alt="enter image description here"></a></p>
  
  <p>I also tried changing the target framework from .net 4.5.1 to 4.6.1, which also did not solve the problem. On a sidenote: changing it to 4.7.1 was not possible, as VS said it was not installed. Installing 4.7.1 was also not possible, with the installer message beeing: Higher Version already installed.</p>