Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Field 'field' is never assigned to, and will always have its default value 'value'
The compiler detected an uninitialized private or internal field declaration that is never assigned a value.
Note
This warning is only reported during explicit Build or Rebuild operations. It does not appear during typing in the IDE as part of IntelliSense diagnostics. This means that if you fix the warning by using the field or removing it, the warning might persist in the error list until you build or rebuild the project again.
The following sample generates CS0649:
// CS0649.cs
// compile with: /W:4
using System.Collections;
class MyClass
{
Hashtable table; // CS0649
// You may have intended to initialize the variable to null
// Hashtable table = null;
// Or you may have meant to create an object here
// Hashtable table = new Hashtable();
public void Func(object o, string p)
{
// Or here
// table = new Hashtable();
table[p] = o;
}
public static void Main()
{
}
}