【发布时间】:2013-07-16 21:09:22
【问题描述】:
我有两本词典:
Dim a As Dictionary(Of String, Type)
Dim b As Dictionary(Of String, Type)
我需要 a 中没有 b 中的内容,应该类似于:
a = a.Except(b)
但它给了我一个例外:
Unable to cast object of type
'<ExceptIterator>d__99`1[System.Collections.Generic.KeyValuePair`2[System.String,System.Type]]'
to type
'System.Collections.Generic.Dictionary`2[System.String,System.Type]'
如果我使用匿名变量,一切正常,但我需要它是强类型的。
对我做错了什么有任何想法吗?
提前致谢!
p.s.:对于那个异常,我猜它必须与 keyValuPair 相关,但我还没有找到解决它的方法。
【问题讨论】:
标签: .net vb.net winforms linq dictionary