Code update problem with MonoDevelop

Hi, all!

This is probably a stupid question; sorry about that.

I want to update a C# script. I open it in MonoDevelop and I change it. File|Save All. And my changes are not taken into account until I restart Unity (which is 5.1.1, by the way). Closing MonoDevelop only is useless.

Is it MonoDevelop, or is it me?

Thanks in advance,

Thierry

the new script wont work if it has errors in it…

Is it happening to all your c# files? Did you try to open another one or does MonoDevelop maybe ask you to convert something and you do not agree?

@WheresMommy

Yes it does happen with all my C# files. Actually it looks like MonoDevelop and Unity aren’t synchronized ; they don’t have the same version of my scripts in memory. If so, what can I do to synchronize them?

In Unity, select:
Assets → Sync MonoDevelop Project

1 Like

Many thanks, Dantus. But why isn’t it done automatically ? It looks incredible to me. Such a loss of time!
Still, that’s how it works :slight_smile:

Thierry

It should happen automatically, and works just fine here with 5.1. Are you sure you have preferences / general / auto refresh checked?

Aaaah, so that was my problem ! Many thanks to you also, Chelnok :smile:

Just fyi, you can also modify scripts while in playmode, and they compile just fine (in most cases) without needing to go route; play, stop, modify, play, stop…

In my experience that is in general not the case. I consciously use a script that stops the play mode when the script compilation kicks in, because it very often leads to different and unexpected behavior.