Why can't I copy/paste code snippets into MonoDevelop?

This is really frustrating. I can copy and paste code from one file to another (both JS and C#) but when I select and copy code from a Unity Answers or Unity Forum page I cannot paste it into MonoDevelop, whether using Control+V or the right click menu or the Edit menu! When I try pasting into a simple text editor it works, but in MonoDevelop it simply does not let me. Is there some particular setting that I need to change or what’s the cause of this? I’ve recently updated Unity to 4.3.3 from 4.3.0 and it seems to be happening since then. I’ve tried changing around the key bindings for the shortcuts but that hasn’t worked either.

I closed MonoDevelop and re-opened it and copy/paste works again.

Alright, so here’s a really weird solution to this really weird problem. I was playing around with the Syntax Highlighting (Tools>Options>Syntax Highlighting) in MonoDevelop and eventually ended up creating my own custom color scheme. Now for some reason I can copy and paste everything fine. Weird! I’m not sure if this is what actually solved this problem, but since I changed those options it’s been back to normal. Maybe this might work for someone else as well. I swear I’ve solved/answered more of my own questions than anyone elses! Hope this helps.

Try this out:

I did some digging if you have ever used Xamarin monodevelop it installs GTKSharp and doesn’t clean up after itself when uninstalled. Unity’s version was incorrectly using the Program Files(x86)\GTKSharp libraries instead of the local ones in Unity\Monodevelop\lib\gtksharp-2.0 . After removing the other copy in program files I can now paste.

See: MonoDevelop 4.0.1 Copy / Paste Issue

Because monodevelop has been awful since they went from 3.x->4.x. Copy/Paste tends to break after you’ve added some new scripts and monodevelop needs to refresh to pull the new files in. Closing it and reopening it will fix it.

I see that you’ve accepted your answer. Well, just in case if this solution won’t work, here’s my recommendation next time.

Here, you can’t just copy-paste directly to script code from Monodevelop. No other option. You must open the script file via Notepad or Wordpad in order to copy-paste your code. Then, return to Monodevelop and it should refreshed it automatically. I assume that the cause of unable to copy-paste code for some reasons:

  • third party fonts
  • third party untrusted code source

For me I just had to close and open monodevelop. Don’t know if this worked on anyone else.

Will this bug ever be fixed? It’s so annoying

I find you don’t need to do anything extreme like reloading Mono-Develop to fix it when it happens, all I need to do is select something in Mono Develop (I just double-click the nearest piece of text) then copy to clipboard (Ctrl-C), I then go back to what I want to copy, and select copy again, then back to Mono-Develop and Paste.

changed the color scheme
now it allows to paste only via RMB menu -
but still not with Ctrl+V shortcut))

Ctrl+ F → Ctrl+ V → Ctrl+ A → Ctrl+ C → Esc → Ctrl+ V → Done.