- Home /
When debugging, MonoDevelop cannot resolve some UnityEngine types in watch/immediate windows
When debugging a project in MonoDevelop it seems that the debugger is unable to resolve some types from UnityEngine namespace. For example, when evaluating expression typeof(GameObject) the result is "Unknown type: UnityEngine.GameObject". Note that debugger sees that GameObject belongs to UnityEngine, yet still returns error.
When typing UnityEngine and then pressing . (dot), intellisense does not display all UnityEngine members. Some of them, GameObject among them, are missing. But, assuming the current script is attached to a GameObject, then typing this.gameObject.#### (where #### can be any GameObject property), somehow refreshes the debugger, making the type visible. It is now accessible via intellisense and typeof(GameObject) no longer returns error.
To reproduce it, just create new empty project, create a cube, create a C# script and attach it to the cube. Put breakpoint inside Start method, attach to Unity Editor process and start the project. After breakpoint is hit, in the immediate window type:
> typeof(GameObject)
Unknown type: UnityEngine.GameObject
> this.gameObject.active
true
> typeof(GameObject)
{UnityEngine.GameObject}
>
Is it possible to prevent such behavior and be able to see all referenced types?
I'm observing this in Unity free 4.1.5f1 and bundled MonoDevelop 2.8.2. Clean install on Win 7 and 8, both x64.
Sadly the debugger is a bit flaky (in 4.1.3 any watch evaluation caused a crash) and it appears that the, once working, collection visualizer is also still broken. Here's hoping for a fix in 4.2
I guess we're lucky then, that it at least does not crash anymore :)
To the guy who downvoted as a revenge for closing his question (you know who you are) - please revert it to the previous state or write what is wrong with this question.
Answer by smishra_unity · Oct 26, 2017 at 01:42 PM
Hi @ArkaneX Getting the same Error, were you able to solve it. Can you explain me how you did it Thanks in advance
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
What port does mono's debugger use 1 Answer
Distribute terrain in zones 3 Answers
how to debug in monodevelop 1 Answer
What's wrong with my script? 2 Answers