MonoDevelop Error while trying to load the project. Invalid character was found.

Hello, having some trouble here.

When I double click a script in Unity and it opens in MonoDevelop, a dialog box pops up with an error.

Error while trying to load the project ‘/Volumes/Projects…’: Invalid character was found. Line 298, position 37.

Then, MonoDevelop shows the message (Load failed) in red next to the Assembly-UnityScript entry in the solution tree.

This just started happening all of a sudden. I’m not able to search or open files through MonoDevelop now. The entire UnityScript tree is missing.

I had the same problem when the project folder was named “C&C”, but the problem only seemed to come up once I had added a Photon networking package.

I opened the offending files in notepad and found the error in this line:

C:/Users/Jeremy/Dropbox/Unity Projects/C&C/Assets/Photon Unity Networking/Editor/PhotonNetwork/Newtonsoft.Json.dll

The error was right after the “&”. I changed the project name and the errors disappeared.
,I had the same problem when my project folder was “C&C”, but it only seemed to show up once I

Solved the problem after some trial and error.

I opened Assembly-UnityScript.unityproj in textedit.

Edit/Find/Select Line.

The line referenced a script in my Unity project.

Went into Unity and deleted the script from my project. That fixed it.

As a test, I dropped the same script back into the Unity project and got the same error with a different line number and position. The script had about 5 lines of code in it and no syntax errors. I’m still not sure why this happened but its fixed. Hope this helps someone.

This problem occurs when the project folder name contains whitespaces. I solved it by removing whitespaces from project folder name.

Found another solution to when you might get this error! I had put two different imported plugins into a directory called “Plugins” which apparently is a special Unity folder. This broke the ability for monodevelop to sync my project and it only provided the very unhelpful error message that lead me to this post. Moving my plugins into a folder called “External” solved this. You can name it whatever you want, but just realize that if you are trying to organize your imported plugins (NGUI, inControl, etc) DON’T put them in “Plugins”.

A project directory had an “&” ampersand character and that isn’t allowed in XML apparently. I replaced it with “&” and that did the trick.

you can delete the error peoject and add it again

I can not solve this problem, I’m already going crazy.