- Home /
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.
Answer by 3duser · Jun 05, 2012 at 03:00 AM
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.
Typically the error is correct, if you follow it down. I had a folder called 'Item⪻ops Pack' and the '&' was throwing this. If you are getting it do as 3duser said and find the line and usually you have to rename it if there is a special symbol.
Answer by 216830_Jwolf · Jul 15, 2014 at 04:11 AM
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
Answer by William Burroughs · Apr 13, 2014 at 07:13 AM
This problem occurs when the project folder name contains whitespaces. I solved it by removing whitespaces from project folder name.
This was not my exact solution but I did have an "&" character in my project folder name. After rena$$anonymous$$g it the errors went away.
Answer by HybridMind · Aug 19, 2014 at 05:54 PM
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".
Answer by swiftest · Nov 22, 2015 at 06:06 PM
A project directory had an "&" ampersand character and that isn't allowed in XML apparently. I replaced it with "&" and that did the trick.
It should be replaced with:
& amp ;
(no spaces). $$anonymous$$y reply above just converted that sequence to the ampersand.
Your answer
Follow this Question
Related Questions
MonoDevelop shows invalid characters 1 Answer
MonoDevelop TODO task won't clear. 2 Answers
Invalid File Error 2 Answers
Really need help for my code! 2 Answers
NSIS Error for Unity 4.0.0 0 Answers