I have a normal Class Library with a function that converts a Byte Array to an Image.
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:
Reference to type 'MarshalByRefObject' claims it is defined in 'mscorlib', but it could not be found
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");
}
}
}
}
My project is targeting:
- .NET Framework 4.5
- ASP.NET Core 1.0
- Windows 8
- Windows Phone 8.1
- Xamarin.Android
- Xamarin.iOS
- Xamarin.iOS (Classic)
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?