共用方式為


編譯器錯誤 C2506

'member' : '__declspec(修飾詞)' 無法套用至此符號

備註

您無法針對 Managed 類別的靜態成員宣告個別進程或個別 appdomain。

如需詳細資訊,請參閱 appdomain

範例

下列範例會產生 C2506。

// C2506.cpp
// compile with: /clr /c
ref struct R {
   __declspec(process) static int n;   // C2506
   int o;   // OK
};