共用方式為


編譯器警告 (層級 1) CS3026

更新:2007 年 11 月

錯誤訊息

符合 CLS 標準的欄位 'field' 不能是 volatile

volatile 變數是不符合 CLS 標準的。

範例

下列範例會產生 CS3026。

// CS3026.cs
[assembly:System.CLSCompliant(true)]
public class Test
{
public volatile int v0 =0;   // CS3026
      // To resolve remove the CLS-CComplient attribute.
public static void Main() { }
}