更新 : 2007 年 11 月
エラー メッセージ
プロパティ、インデクサまたはイベント 'name' はこの言語でサポートされていません。アクセサ メソッドの 'name!' を直接呼び出してください。
このエラーが発生するのは、別のコンパイラによって生成され、インポートされたメタデータを使用するときです。コンパイラで処理できないクラス メンバの使用を試みました。
使用例
次の C++ プログラムでは RequiredAttributeAttribute 属性を使用しますが、この属性は他の言語では利用できません。
// CPP0570.cpp
// compile with: /clr /LD
using namespace System;
using namespace System::Runtime::CompilerServices;
namespace CS0570_Server {
[RequiredAttributeAttribute(Int32::typeid)]
public ref struct Scenario1 {
int intVar;
};
public ref struct CS0570Class {
Scenario1 ^ sc1_field;
property virtual Scenario1 ^ sc1_prop {
Scenario1 ^ get() { return sc1_field; }
}
Scenario1 ^ sc1_method() { return sc1_field; }
};
};
次の例では CS0570 エラーが生成されます。
// CS0570.cs
// compile with: /reference:CPP0570.dll
using System;
using CS0570_Server;
public class C {
public static int Main() {
CS0570Class r = new CS0570Class();
r.sc1_field = null; // CS0570
object o = r.sc1_prop; // CS0570
r.sc1_method(); // CS0570
}
}