14

I've added the necessary using statement. using System.Collections.Generic to the top of my class and the compiler happily accepts my use of Lists, but when I'm debugging I'm getting a very weird debugging problem in that when I expand my lists instead I get:

unknown type 'System.Collections.Generic.CollectionDebuggerView'1 mscorlib.

What possible reasons could there be? Google didn't seem to help me...

The lists do seem to declare their information when declared and empty and they are defined with a class I've created, but I've never seen this issue in any other toolkit such as XNA etc.

I shoudl also mention that this is through MonoDevelop I see this error.

Thanks.

3
  • The unity tag is reserved by Microsoft Unity. Please use unity3d tag for what you want to ask.
    – Lex Li
    Jan 15, 2013 at 5:45
  • 4
    Still there in Unity 4.3 ...
    – Danvil
    Nov 14, 2013 at 21:27
  • Still there in Unity 4.6 :(
    – Netherwire
    Dec 9, 2014 at 8:09

3 Answers 3

10

It was a bug in Mono according to these release notes. It's patched in 2.10.2, but Unity isn't using the patched Mono build.

679586: Unknown type System.Collections.Generic.CollectionDebuggerView error when viewing Parametrized collection in debugger

Unity uses Mono 2.6. Without access to the source for Unity, I'm not sure how you can implement that patch. Even with the source, 2.6 is still the stable build so 2.10.2 so it may cause issues elsewhere.

4
  • You should use mono 2.10.x anyway. mono 2.6.x is unstable and sometimes crash program for unknown reason.
    – linquize
    Jan 15, 2013 at 2:02
  • According to their release notes - Mono 2.10 ships the latest and greatest and updates and they have not received as much testing as they should. Users seeking absolute stability should stay on Mono 2.6. Users switching to Mono 2.10, should expect a faster bug turn around time, but they should also plan on upgrading to the upcoming 2.10.xx series as we fix bugs in our stack. I guess it depends if the patch has fixed issues you've faced.
    – keyboardP
    Jan 15, 2013 at 3:47
  • 3
    An upvote for the correct information... but I wish I could downvote the situation. Jan 27, 2013 at 19:39
  • 1
    the problem is still in Unity 4.5, which is using Mono 2.10.11. any idea?
    – JeanLuc
    Jun 25, 2014 at 14:21
2

Used .ToArray() method to convert my List<T> to T[] array. Just don't forget to sweep this code in release!

0

Quick and dirty workaround which works for me:

private class CellList : List<Cell> {}

Somehow it displays correctly in debugger.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.