Compiler Warning (level 1) CS3026
CLS-compliant field 'field' cannot be volatile
A volatile variable should not be CLS compliant.
The following example generates CS3026.
C#
// CS3026.cs
[assembly:System.CLSCompliant(true)]
public class Test
{
public volatile int v0 =0; // CS3026
// To resolve remove the CLS-Compliant attribute.
public static void Main() { }
}
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: