Can't open MonoDevelop

I’m running Unity on Elementary OS Freya, and I noticed MonoDevelop wasn’t opening. I tried opening it directly from the Unity installation folder, but it gave me the error below:

daniel@netherstorm:~$ /opt/Unity/MonoDevelop/bin/monodevelop
Missing method .ctor in assembly /opt/Unity/MonoDevelop/lib/monodevelop/bin/MonoDevelop.Ide.dll, type System.Runtime.CompilerServices.ExtensionAttribute
Can't find custom attr constructor image: /opt/Unity/MonoDevelop/lib/monodevelop/bin/MonoDevelop.Ide.dll mtoken: 0x0a0019cd
* Assertion at class.c:5597, condition `!mono_loader_get_last_error ()' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /home/builduser/buildslave/monodevelop/build/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:16
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>

Native stacktrace:

   monodevelop() [0x4b73d8]
   /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f8d792af340]
   /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f8d78f10cc9]
   /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f8d78f140d8]
   monodevelop() [0x638575]
   monodevelop() [0x6386b6]
   monodevelop() [0x5298e6]
   monodevelop(mono_class_get_full+0xe2) [0x52a0c2]
   monodevelop(mono_class_from_name+0xfe) [0x52a4ae]
   monodevelop(mono_class_from_typeref+0x190) [0x529d00]
   monodevelop(mono_class_get_full+0x145) [0x52a125]
   monodevelop(mono_metadata_parse_mh_full+0x49f) [0x56c17f]
   monodevelop() [0x43b316]
   monodevelop() [0x421e2e]
   monodevelop() [0x4253cd]
   monodevelop() [0x425ecb]
   monodevelop() [0x4b845b]
   [0x4005c166]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operação não permitida.
No threads.

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Running it as root, the error changes to this:

daniel@netherstorm:~$ sudo /opt/Unity/MonoDevelop/bin/monodevelop
Missing method .ctor in assembly /opt/Unity/MonoDevelop/lib/monodevelop/bin/MonoDevelop.Ide.dll, type System.Runtime.CompilerServices.ExtensionAttribute
Can't find custom attr constructor image: /opt/Unity/MonoDevelop/lib/monodevelop/bin/MonoDevelop.Ide.dll mtoken: 0x0a0019cd
* Assertion at class.c:5597, condition `!mono_loader_get_last_error ()' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00000] in /home/builduser/buildslave/monodevelop/build/monodevelop/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:16
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>

Native stacktrace:

   monodevelop() [0x4b73d8]
   /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fe1b12ab340]
   /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7fe1b0f0ccc9]
   /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fe1b0f100d8]
   monodevelop() [0x638575]
   monodevelop() [0x6386b6]
   monodevelop() [0x5298e6]
   monodevelop(mono_class_get_full+0xe2) [0x52a0c2]
   monodevelop(mono_class_from_name+0xfe) [0x52a4ae]
   monodevelop(mono_class_from_typeref+0x190) [0x529d00]
   monodevelop(mono_class_get_full+0x145) [0x52a125]
   monodevelop(mono_metadata_parse_mh_full+0x49f) [0x56c17f]
   monodevelop() [0x43b316]
   monodevelop() [0x421e2e]
   monodevelop() [0x4253cd]
   monodevelop() [0x425ecb]
   monodevelop() [0x4b845b]
   [0x40196166]

Debug info from gdb:

[New LWP 9859]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fe1b12aaee9 in __libc_waitpid (pid=pid@entry=9860, stat_loc=stat_loc@entry=0x7ffde6763acc, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
40   ../sysdeps/unix/sysv/linux/waitpid.c: Arquivo ou diretório não encontrado.
  Id  Target Id  Frame
  2  Thread 0x7fe1ae6df700 (LWP 9859) "mono" sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
* 1  Thread 0x7fe1b1dca7c0 (LWP 9857) "mono" 0x00007fe1b12aaee9 in __libc_waitpid (pid=pid@entry=9860, stat_loc=stat_loc@entry=0x7ffde6763acc, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40

Thread 2 (Thread 0x7fe1ae6df700 (LWP 9859)):
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1  0x000000000062f667 in mono_sem_wait (sem=sem@entry=0x982440 <finalizer_sem>, alertable=alertable@entry=1) at mono-semaphore.c:119
#2  0x00000000005aba15 in finalizer_thread (unused=unused@entry=0x0) at gc.c:1073
#3  0x000000000058e34b in start_wrapper_internal (data=0x1b1d7c0) at threads.c:643
#4  start_wrapper (data=0x1b1d7c0) at threads.c:688
#5  0x000000000062410d in thread_start_routine (args=args@entry=0x1a96ea8) at wthreads.c:294
#6  0x0000000000633ef5 in inner_start_thread (arg=0x1b1d640) at mono-threads-posix.c:49
#7  0x00007fe1b12a3182 in start_thread (arg=0x7fe1ae6df700) at pthread_create.c:312
#8  0x00007fe1b0fd047d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7fe1b1dca7c0 (LWP 9857)):
#0  0x00007fe1b12aaee9 in __libc_waitpid (pid=pid@entry=9860, stat_loc=stat_loc@entry=0x7ffde6763acc, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#1  0x00000000004b7465 in mono_handle_native_sigsegv (signal=<optimized out>, ctx=<optimized out>) at mini-exceptions.c:2299
#2  <signal handler called>
#3  0x00007fe1b0f0ccc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#4  0x00007fe1b0f100d8 in __GI_abort () at abort.c:89
#5  0x0000000000638575 in monoeg_g_logv (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x6410a8 "* Assertion at %s:%d, condition `%s' not met\n", args=args@entry=0x7ffde6764a28) at goutput.c:175
#6  0x00000000006386b6 in monoeg_assertion_message (format=format@entry=0x6410a8 "* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:195
#7  0x00000000005298e6 in mono_class_create_from_typedef (image=0x1aaae70, type_token=33554681, error=error@entry=0x7ffde6764bf0) at class.c:5597
#8  0x000000000052a0c2 in mono_class_get_full (image=0x1aaae70, type_token=33554681, context=<optimized out>) at class.c:7098
#9  0x000000000052a4ae in mono_class_get (type_token=33554681, image=0x1aaae70) at class.c:7194
#10 mono_class_from_name (image=0x1aaae70, name_space=name_space@entry=0x7fe1ae4502b7 "System", name=name@entry=0x7fe1ae4507eb "Exception") at class.c:7565
#11 0x0000000000529d00 in mono_class_from_typeref (image=0x1b2a1c0, type_token=<optimized out>) at class.c:263
#12 0x000000000052a125 in mono_class_get_full (image=0x1b2a1c0, type_token=16777257, context=<optimized out>) at class.c:7107
#13 0x000000000056c17f in parse_section_data (ptr=0x7fe1ae1e629c "", num_clauses=<optimized out>, m=<optimized out>) at metadata.c:3345
#14 mono_metadata_parse_mh_full (m=0x1b2a1c0, container=0x0, ptr=<optimized out>) at metadata.c:3511
#15 0x000000000054d44e in mono_method_get_header (method=method@entry=0x1b5a0e8) at loader.c:2619
#16 0x000000000043b316 in mono_method_to_ir (cfg=cfg@entry=0x1b23fe0, method=method@entry=0x1b5a0e8, start_bblock=start_bblock@entry=0x0, end_bblock=end_bblock@entry=0x0, return_var=return_var@entry=0x0, dont_inline=dont_inline@entry=0x0, inline_args=inline_args@entry=0x0, inline_offset=inline_offset@entry=0, is_virtual_call=is_virtual_call@entry=0) at method-to-ir.c:6651
#17 0x0000000000421e2e in mini_method_compile (method=0x1b5a0e8, opts=opts@entry=370239999, domain=domain@entry=0x1aa3630, flags=flags@entry=JIT_FLAG_RUN_CCTORS, parts=parts@entry=0) at mini.c:5193
#18 0x00000000004253cd in mono_jit_compile_method_inner (jit_ex=0x7ffde6765bb8, opt=370239999, target_domain=0x1aa3630, method=0x1b5a0e8) at mini.c:5940
#19 mono_jit_compile_method_with_opt (method=method@entry=0x1b5a0e8, opt=370239999, ex=ex@entry=0x7ffde6765bb8) at mini.c:6211
#20 0x0000000000425ecb in mono_jit_compile_method (method=0x1b5a0e8) at mini.c:6248
#21 0x00000000004b845b in common_call_trampoline (regs=0x7ffde6765e78, code=0x41de6db4 "H\203\304\b\303\350B\362:\376\004蠵\001", m=0x1b5a0e8, vt=0x0, vtable_slot=<optimized out>, need_rgctx_tramp=0, tramp=<optimized out>) at mini-trampolines.c:576
#22 0x0000000040196166 in ?? ()
#23 0x0000000000000007 in ?? ()
#24 0x0000000000000000 in ?? ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Just tried the solution on the above thread and it worked fine. Sorry for posting this.