MonoDevelop will not save

I am attempting to save the C# script from lesson 7 and have gotten this error every time.

https://pastebin.com/dqF1Kghz

I have reinstalled (w/complete uninstall) Unity and MonoDevelop multiple times without success.

I have set Unity and MonoDevelop to launch as administrator without success.

Visual Studio can save to this script to this location without fail.

Help me get past this roadblock?

Hi,

In that error message it suggests you have perhaps a . and a # at the beginning of the file name, is that the case or just something odd happening in the error message?

Assuming that isn’t in the filename, the next part of the error is pointing to security attributes, one of the easiest ways to test this theory would be to save in a non-user directory, for example, just create a directory on the main root of C:, perhaps C:\Dev, and see if you can save the project to there.

Hi Rob.

I’m not sure what’s with those characters, they’re not part of the file name.

I just saved successfully to a new folder (C:\DEV) as well as to my desktop.

edit: I have verified full permissions in every way I know how and launched unity/monodev as admin.

1 Like

Ok, so that’s good news and if you can’t see those characters in the filename, even better.

I would probably start to rule things out one by now, although, for the record, I don’t ever save project/development work to a C:\Users directory anyway. Visual Studio used to have issues with very long path names and I found that if I saved the work in these directories it was unnecesarily long, so for me, it is D:\Dev.

Out of interest, did you create the script in MonoDevelop, or from within Unity and then opened it in MonoDevelop?

I would probably try a few tests on the \Documents directory, create a new project and try again, then perhaps try other directories other than the \Documents one, can you save everywhere but here.

Do you have any anti-virus running that may see these file extensions as a risk and is intervening?

I use Bitdefender but its not kicking up a fuss.

Sorry, I left out some troubleshooting info from earlier, I had done a string of saves as you suggested and found that the problem begins at the Documents folder (I can save to various other folders for that same user).

Ok, so this is good, you’re narrowing it down.

Presumably this is the user account you are logged in as, and you have admin rights on the computer etc.

Which version of Windows and Unity are you using?

Windows 10 and Unity 4.6.9f1

I’m going through a Udemy course and trying to stick to their version/folder layout for ease of following.

Is this the only version of Unity you have installed?

Yep

…and what steps did you take to create the script, was it;

  • within Unity, create script, double-click to open in MonoDevelop, MonoDevelop lauches, script appears

or

  • within MonoDevelop, create a new script, save within /Assets directory

or other of course?

The first method. Right click, create C# script, double click script, modify, save as…

Within unity

So, the modify and save as are happening within MonoDevelop, and that is when the error occurs?

Correct

And the permissions seems unique to Monodevelop as VisualStudio (and notepad) are able to save to the Documents folder

Ok, so let’s come at it from another angle…

Instead of modifying and then saving as within MonoDevelop, create a script within Unity as before, but rename it within Unity. Save the project from the File menu, now double-click the renamed scripted which will launch MonoDevelop. See if it is possible to edit it and then just “save” as opposed to “save-as”.

Nope :frowning:

Meaning, I followed those steps and received the error once I hit the save command in MonoDev

So the project is definitely saved within Unity before opening the new script in MonoDevelop?

Seems quite odd behaviour, but of course it’s a very old version of Unity and Windows 10 wasn’t around then.

There are a number of things which could be factors and trying to work through all of them will probably just have you going around in circles.

You could try installing a newer version of Unity, later in the course you upgrade to version 5.x anyway, and to be honest there isn’t really much reason not to just use 2017. There are some API differences but these are documented in the course and also on the forum.

You can install multiple version of Unity, as you are on Windows you will be given an option to specify the install location, so for example you could try Unity 5.6.5 and install to \Unity 5.6.5, this would keep it completely separate from the older version - you could then repeat the test.

Another thought is that MonoDevelop is quite inferior to Visual Studio and there really isn’t any reason not to use Visual Studio, especially as you know that actually does work. It is much more feature rich than MonoDevelop, a lot of people switch as they progress anyway.

Fathoming this one out I think may depend on how much time you want to spend on trying to get an old version of Unity to work with an inferior text editor, to save in a less than ideal location on your computer :wink:


Updated Tue Apr 17 2018 00:14

Just another thought… do you happen to have anything else open which could be using that file, more than one copy of MonoDevelop for example, or anything else? Or even multiple times within the one instance of MonoDevelop, e.g. same file two tabs?

Thank you for all your help Rob.

I’m thinking you’re right, its time to work around the problem as its just not worthwhile to fix it.

For now, its break time!

Thanks again, cheers!

1 Like

So I just remade my “repos” folder at the C: level and all is well.

1 Like

Probably the easiest way to go. I’m sure with enough time you’d have sorted it for the My Documents folder, but all the time invested in that is less time having fun with the course. Sorry we couldn’t quite get there though, frustrating when things like that occur.

Privacy & Terms