| description | Learn more about: Compiler Error C2506 | |
|---|---|---|
| title | Compiler Error C2506 | |
| ms.date | 11/04/2016 | |
| f1_keywords |
|
|
| helpviewer_keywords |
|
|
| ms.assetid | cfed21cd-2404-46f2-985e-d0c2c3820830 |
'member' : '__declspec(modifier)' cannot be applied to this symbol
You cannot declare per-process or per-appdomain for static members of a managed class.
See appdomain for more information.
The following sample generates C2506.
// C2506.cpp
// compile with: /clr /c
ref struct R {
__declspec(process) static int n; // C2506
int o; // OK
};