我收到錯誤的定義:「字符串[]」不包含「演員」
'string[]' does not contain a definition for 'Cast' and no extension method 'Cast' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?)
在下面的一段代碼:
return mNames.Cast().ToArray();
什麼using指令或程序集引用我需要? 我如何找出這些東西?我是C#和.NET的noob,我只是複製代碼來完成一項工作,所以不要太過於技術上的問題。
如果mNames是一個數組,爲什麼你試圖將其轉換爲一個數組? –
'mNames'是什麼類型? –
['Enumerable.Cast'](http://msdn.microsoft.com/en-us/library/bb341406.aspx#Y1254)將「IEnumerable」的元素轉換爲**指定的**類型,但是您沒有指定類型。 –