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.
The following sample generates CS8355:
using System.Runtime.InteropServices;
class Program
{
public static void Example([Out] in int value) // CS8355
{
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: