IanRyder
Well-known member
Hi All,
I have come across a couple of issues recently trying to help people where the properties and methods that I have provided in code examples, which worked in my own version of VS (being VS2010 Ultimate), were not available and therefore did not work for other users in their installation of Visual Studio. Both examples are to do with the Array collection and specifically the .Count property and the .ToList method. Examples of this are:-
I have looked at various things over the past few weeks (comparing .NET versions and VS Versions) and the best that I have got so far is that the .ToList method needed a reference to LINQ and the .Count property needed a reference to the MSCORLIB assembly. However, after suggesting these points to solve users problems none of them seem to have worked?
In both instances I have felt a bit "useless" since I have not been able to solve the users issue, so my question is, can anyone give me any pointers as to why this sort of thing would occur? I am sure I am missing something simple but I just do not what that "something simple" may be.
Cheers and kind regards,
Ian
I have come across a couple of issues recently trying to help people where the properties and methods that I have provided in code examples, which worked in my own version of VS (being VS2010 Ultimate), were not available and therefore did not work for other users in their installation of Visual Studio. Both examples are to do with the Array collection and specifically the .Count property and the .ToList method. Examples of this are:-
VB.NET:
Dim testArray() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
MsgBox(testArray.Count)
Dim testList As List(Of Integer) = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.ToList
'I Know you can use From when declaring a List but please ignore this since the
'above is what I am trying to understand why it did not work on another users system
'Dim testListUsingFrom As New List(Of Integer) From {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
MsgBox(testList.Count)
I have looked at various things over the past few weeks (comparing .NET versions and VS Versions) and the best that I have got so far is that the .ToList method needed a reference to LINQ and the .Count property needed a reference to the MSCORLIB assembly. However, after suggesting these points to solve users problems none of them seem to have worked?
In both instances I have felt a bit "useless" since I have not been able to solve the users issue, so my question is, can anyone give me any pointers as to why this sort of thing would occur? I am sure I am missing something simple but I just do not what that "something simple" may be.
Cheers and kind regards,
Ian