我有兩個字典:(LINQ)字典:除了不返回字典
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相關的東西,但我還沒有找到解決的辦法。
我試圖說,但由於某些原因,當我'x.'這不是讓我用'Key' – Luis
@Luis這絕對* *應工作。我自己測試它只是爲了確保。 –
嗯,我關閉VS,重新打開它,重建並...它的工作...謝謝 – Luis