'How to new an Image<TPixel> with ImageSharp 2.0.0 in VS2017

Following the docs at the Getting Started page (although without newer language features), I have the following code:

using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

public class Test
{
    public void CreateImage()
    {
        using (Image<Rgba32> image = new Image<Rgba32>(100, 100))
        {
            // code
        }
    }
}

I'm seeing both cases of Rgba32 underlined with the error message:

The type 'SixLabors.ImageSharp.PixelFormats.Rgba32' must be valid unmanaged type (simple numeric, 'bool', 'char', 'void', enumeration type or non-generic struct type with all fields of unmanaged types at any level of nesting) in order to use it as a type argument for 'TPixel' parameter.

As far as I can see the above code is equivalent and complete re the example code. Does there need to be some extra configuration in relation to unmanaged types to get this to work?

(This looks maybe related to this VB issue on GitHub, but my Project is C# 7.0 / .Net Standard 2.0)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source