Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity, weird debugging

Tags:

c#

list

unity3d

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.

like image 773
Bushes Avatar asked Jan 15 '13 00:01

Bushes


2 Answers

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.

like image 103
keyboardP Avatar answered Sep 23 '22 14:09

keyboardP


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

like image 2
Netherwire Avatar answered Sep 20 '22 14:09

Netherwire