Edit

Share via


Compiler Error CS8355

An in parameter cannot have the Out attribute.

The parameter of a method can't be declared as read only, while informing interop marshaler to treat this parameter as writable by the native code.
OutAttribute will contradict to the in keyword when marshalling.

Example

The following sample generates CS8355:

using System.Runtime.InteropServices;

class Program
{
    public static void Example([Out] in int value)    // CS8355
    {
    }
}

See also