Search code examples
c#visual-studiounity-game-enginemonodevelop

Unity can not debug using MonoDevelop. And, UnityEngine is not loaded


I am using Unity 5.4.1f1 Japanese version. I installed Visual Stduio 2015 Community and Visual Studio Tool. But, I wanted to return to MonoDevelop, I uninstalled Unity and Visual Studio. And I installed Unity again.

After that, when I press the play button on the top left of MonoDevelope, the following error will be displayed. And I can not start debugging.

PATH\Assembly-CSharp.csproj(22,22): Error MSB4066: 要素 <ProjectExtensions> の属性 "xmlns" は認識されていません。 (MSB4066) (Assembly-CSharp)

Also, the UnityEngine namespace will not load with the following error.

error CS0103: The name `UnityEngine' does not exist in the current context

All GameObjects and MonoBehaviours in the source code are displayed as errors. However, only MonoDevelop gives an error. I can run games on Unity. How can I resolve this error?


Solution

  • I solved it myself. I was setting the Code Formatting option of the assembly. Then, it seems that the csproj file contains tags that MonoDevelop can not read. When setting Code Formatting in the project option, the error disappeared.