'member' : __declspec(thread) をマネージド クラスまたは WinRT クラスのメンバーに適用できません
thread の __declspec
修飾子は、マネージド クラスまたは Windows ランタイム クラスのメンバーでは使用できません。
マネージド コード内の静的なスレッド ローカル ストレージは、静的に読み込まれた DLL に対してのみ使用できます。DLL は、プロセスの開始時に静的に読み込まれる必要があります。 Windows ランタイムでは、スレッド ローカル ストレージはサポートされません。
次の例では、C2384 を生成し、C++/CLI コードで修正する方法を示しています。
// C2384.cpp
// compile with: /clr /c
public ref class B {
public:
__declspec( thread ) static int tls_i = 1; // C2384
// OK - declare with attribute instead
[System::ThreadStaticAttribute]
static int tls_j;
};