匿名オブジェクトのリストを作成します。だから私はこれをしなかった:「ダイナミック」タイプを使用すると、コンパイルエラーが発生します
var problematicAddresses = new HashSet<dynamic>();
foreach (DataRow row in dtMeters.Rows)
{
var billingAddress = new
{
address = row["BillingAddress"].ToString(),
city = row["BillingCity"].ToString(),
state = row["BillingState"].ToString(),
zip = row["BillingZip"].ToString()
};
// ... fill problematicAddresses without any problem
foreach (var completeAddress in problematicAddresses)
{
string addr = completeAddress.address;
// ...
}
// ...
}
ここで最後の行は、コンパイル、私に次のエラーを与えていない:
One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?
あなたはこれで私を助けていただけますか?
ありがとうございました。
上の文字列の代わりにまた、使用するvar ...あなたはそれらのLIBSが含まれていることを確認してくださいそれは文字通りあなたの右のエラーメッセージの問題と解決策を伝えます。 – MikeP
@sll彼の 'HashSet'は'動的 '型です。 –
エラーメッセージのどの部分が不明ですか? –