Tracking down causes of Editor errors.

Is there a way to track down the errors that the editor gives that don’t have callstacks?

Specifically I’m getting the errors:

CompareBaseObjects can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

Can’t destroy Transform component. If you want to destroy the game object please call ‘Destroy’ on the game object instead. Destroying the transform component is not allowed.

The only other information that these errors provide is the Unity internal source file that caused the errors:
c:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/UnityEngineObject.cpp at line: 19
c:/BuildAgent/work/812c4f5049264fad/Runtime/Misc/GameObjectUtility.cpp at line: 1011

I’ve searched my code and haven’t been able to follow the advice in the errors. Is there any additional information that can be gleaned? The editor log doesn’t provide any more information. I know that my scripts are the source of the problem but I need to narrow down the problem before I can fix it.

You can use MonoDevelop to help tracking down errors like this, at least if they’re caused by exceptions being thrown. Unfortunately Unity will often only log a debug message when an error occurs rather than throwing an exception.

To debug exceptions, do the following:
In MonoDevelop, open Run->Exceptions, and move all the exceptions except for UnityEngine.ExitGUIException to the “Stop in exceptions” window.
Now attach MonoDevelop to the Unity editor and enter play mode.
MonoDevelop will now break whenever any of the exceptions are thrown, even from threads other than the main thread.