title: Portable class library - Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found
body: <p>I have a normal Class Library with a function that converts a Byte Array to an Image.</p>
  
  <p>Now I've deleted that Class Library and created a Portable Class Library with the same name and now the code does not seem to work anymore and gives me an error on the "FromStream"-function:</p>
  
  <blockquote>
    <p>Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found</p>
  </blockquote>
  
  <pre><code>using System;
  using System.Drawing;
  using System.IO;
  
  namespace App.Converters
  {
      public static class Converter
      {
          public static Image ToImage(this byte[] byteArray)
          {
              try
              {
                  return Image.FromStream(new MemoryStream(byteArray));
              }
              catch
              {
                  throw new FormatException("Data is not an image");
              }
          }
      }
  }
  </code></pre>
  
  <p>My project is targeting:</p>
  
  <ul>
  <li>.NET Framework 4.5</li>
  <li>ASP.NET Core 1.0</li>
  <li>Windows 8</li>
  <li>Windows Phone 8.1</li>
  <li>Xamarin.Android</li>
  <li>Xamarin.iOS</li>
  <li>Xamarin.iOS (Classic)</li>
  </ul>
  
  <p>Is this because "something" is not supported in one of the frameworks I'm targeting? Then why does VS let me use and show it in auto-complete?</p>