Does it need Monodevelop's old version that compile mono-develop 3.1.0 version? - mono

When I compile Monodevelop 3.1.0 for macosx from source in terminal,it failed.But when I open the 'MonoDevelop.mdw' using Monodevelo 2.8.2,using 'Run' function to build it,then it runs.But why?
Errors As follows:
Last login: Tue Jun 12 09:22:05 on console
starmatoMacBook-Pro:~ star$ cd /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop
starmatoMacBook-Pro:monodevelop star$ make runcd main && make run
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" PKG_CONFIG_PATH="/Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/local-config:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:" LD_LIBRARY_PATH="" DYLD_FALLBACK_LIBRARY_PATH="" MONO_GAC_PREFIX="/usr/local:" MONODEVELOP_LOCALE_PATH="./build/locale" MONO_ADDINS_REGISTRY="./build/bin" UBUNTU_MENUPROXY=0 exec -a "monodevelop" /usr/bin/mono --debug ./build/bin/MonoDevelop.exe
ERROR [2012-06-12 10:18:40Z]: Error setting process name
System.DllNotFoundException: libc.dylib
at (wrapper managed-to-native) MonoDevelop.Core.Runtime:prctl (int,byte[],intptr,intptr,intptr)
at MonoDevelop.Core.Runtime.unixSetProcessName (System.String name) [0x00000] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:257
at MonoDevelop.Core.Runtime.SetProcessName (System.String name) [0x00010] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:240
ERROR [2012-06-12 10:18:41Z]: Error initialising GLib logging.
System.DllNotFoundException: libglib-2.0.0.dylib
at (wrapper managed-to-native) GLib.Marshaller:g_malloc (uintptr)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00000] in <filename unknown>:0
at GLib.Log.SetLogHandler (System.String logDomain, LogLevelFlags flags, GLib.LogFunc logFunc) [0x00000] in <filename unknown>:0
at MonoDevelop.Ide.Gui.GLibLogging.set_Enabled (Boolean value) [0x00030] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/GLibLogging.cs:50
at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x00056] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:88
FATAL ERROR [2012-06-12 10:18:41Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp, gnome-sharp or gtkhtml-sharp) may not be properly installed in the GAC.
System.TypeInitializationException: An exception was thrown by the type initializer for Gtk.Application ---> System.DllNotFoundException: glibsharpglue-2
at (wrapper managed-to-native) GLib.Thread:glibsharp_g_thread_supported ()
at GLib.Thread.get_Supported () [0x00000] in <filename unknown>:0
at Gtk.Application..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x0007e] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:95
at MonoDevelop.Ide.IdeStartup.Main (System.String[] args) [0x0004f] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:503
make[1]: *** [runmd] Error 255
make: *** [run] Error 2
starmatoMacBook-Pro:monodevelop star$

Your DYLD_LIBRARY_FALLBACK_PATH environment variable is broken. You can fix it with:
export DYLD_LIBRARY_FALLBACK_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"

Related

Creating Roslyn MetadataFileReference bombs on mono/Linux

I'm doing on some basic Roslyn stuff, and have run into what appears to be a mono compatibility issue. Wanted to make sure I'm not doing something wrong and hear other people's experience. Am using Roslyn from the Microsoft.CodeAnalysis nuget, version 0.7.4091001-beta (latest).
var mscorlib = new MetadataFileReference(typeof(object).Assembly.Location);
var compilation = CSharpCompilation.Create("Temp", new SyntaxTree[0], new[] { mscorlib });
compilation.GetAssemblyOrModuleSymbol(mscorlib);
While this works on Microsoft .NET, on mono on Linux the last line produces the following exception:
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Absolute path expected.
Parameter name: fullPath
at Microsoft.CodeAnalysis.CommonReferenceManager`2[Microsoft.CodeAnalysis.CSharp.CSharpCompilation,Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol].ResolveMetadataReferences (Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation, System.Collections.Immutable.ImmutableArray`1& references, IDictionary`2& boundReferenceDirectiveMap, System.Collections.Immutable.ImmutableArray`1& boundReferenceDirectives, System.Collections.Immutable.ImmutableArray`1& assemblies, System.Collections.Immutable.ImmutableArray`1& modules, Microsoft.CodeAnalysis.DiagnosticBag diagnostics) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation+ReferenceManager.CreateAndSetSourceAssemblyFullBind (Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation+ReferenceManager.CreateSourceAssemblyForCompilation (Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetBoundReferenceManager () [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetAssemblyOrModuleSymbol (Microsoft.CodeAnalysis.MetadataReference reference) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonGetAssemblyOrModuleSymbol (Microsoft.CodeAnalysis.MetadataReference reference) [0x00000] in <filename unknown>:0
at Microsoft.CodeAnalysis.Compilation.GetAssemblyOrModuleSymbol (Microsoft.CodeAnalysis.MetadataReference reference) [0x00000] in <filename unknown>:0
at playground2.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
There's obviously some sort of path parsing Linux/Windows sadness going on here. My current workaround is to create the reference to corlib thus:
var mscorlibMetadata = AssemblyMetadata.CreateFromImageStream(new FileStream(typeof(object).Assembly.Location, FileMode.Open, FileAccess.Read));
var mscorlib = new MetadataImageReference (mscorlibMetadata);
Does anybody know anything about this?
This is a bug in Roslyn.
You can send them a pull request to fix PathUtilities.GetPathKind to be aware of Linux-style paths by checking Path.DirectorySeparatorChar.

Access to the path "/etc/mono/registry" is denied

When I run my ASP.NET MVC 4 website on my Fedora 20 workstation with xsp4 (from MonoDevelop or directly) I'm getting the following exception:
System.Web.HttpRuntime.FinishWithException (wr={Mono.WebServer.XSPWorkerRequest}, e={System.Web.HttpException: ---> System.Web.HttpException: The pre-application start initialization method Start on type System.Web.WebPages.PreApplicationStartCode threw an exception with the following error message: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: An exception was thrown by the type initializer for <Module> ---> System.Security.SecurityException: No access to the given key ---> System.UnauthorizedAccessException: Access to the path "/etc/mono/registry" is denied.
at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00064] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:113
at System.IO.Directory.CreateDirectory (System.String path) [0x000a4] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:80
at System.IO.DirectoryInfo.Create () [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/DirectoryInfo.cs:141
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:Create ()
at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00039] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:98
at System.IO.Directory.CreateDirectory (System.String path) [0x000a4] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:80
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, Boolean is_volatile) [0x0004a] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:136
--- End of inner exception stack trace ---
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, Boolean is_volatile) [0x00057] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:138
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:116
at Microsoft.Win32.KeyHandler.Lookup (Microsoft.Win32.RegistryKey rkey, Boolean createNonExisting) [0x000cc] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:412
at Microsoft.Win32.UnixRegistryApi.OpenSubKey (Microsoft.Win32.RegistryKey rkey, System.String keyname, Boolean writable) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:836
at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name, Boolean writable) [0x0001e] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:278
at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:262
at (wrapper remoting-invoke-with-check) Microsoft.Win32.RegistryKey:OpenSubKey (string)
at Microsoft.Web.Infrastructure.RegistryKeyWrapper.OpenSubKey (System.String name) [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.KillBitHelper.GetKillBittedVersions () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.KillBitHelper.IsThisAssemblyKillBitted () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.KillBitHelper.ThrowIfKillBitIsSet () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.ModuleInitializer+CriticalInitializer.CheckKillBit () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.ModuleInitializer+CriticalInitializer.Initialize () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.ModuleInitializer.Initialize () [0x00000] in <filename unknown>:0
at <Module>..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Web.WebPages.PreApplicationStartCode.Start () [0x0002b] in /builddir/build/BUILD/mono-3.4.0/external/aspnetwebstack/src/System.Web.WebPages/PreApplicationStartCode.cs:40
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00069] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:238
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MethodBase.cs:114
at System.Web.Compilation.BuildManager.CallPreStartMethods () [0x0004f] in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:561
--- End of inner exception stack trace ---
at System.Web.Compilation.BuildManager.CallPreStartMethods () [0x0007e] in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:564
at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00059] in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs:408
--- End of inner exception stack trace ---}) in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web/HttpRuntime.cs:674
I've checked it and there is no registry file or folder in /etc/mono/. I also can't find it in any subfolder, how can I resolve this question?
I'm running Fedora 20 with the latest 3.15.6 kernel
$ mono --version
Mono JIT compiler version 3.4.0 (tarball Fri Jun 27 17:26:36 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
$ xsp4 --version
xsp4.exe 3.0.0.0
Copyright (C) 2002-2011 Novell, Inc.
Minimalistic web server for testing System.Web
I have another setup in Ubuntu 14.04 LTS and that one works, so it might be something with the mono version, or maybe I'm missing some library?
Turns out simply creating the folder using mkdir
sudo mkdir /etc/mono/registry
and setting the right permissions using chmod
sudo chmod uog+rw /etc/mono/registry
does the trick.
However I still don't understand where such a folder is hidden in Ubuntu and why it doesn't need to be created there, as well as why it isn't created automatically during the installation.
You can set MONO_REGISTRY_PATH to point to a directory that you control:
bash
mkdir my-registry
MONO_REGISTRY_PATH=`pwd`/my-registry
xsp4

How does one set the filename in Monodevelop?

I have recently installed MonoDevelop V3.0.3.2 on Linux Mint 15 MATE 64-bit.
I installed MonoDevelop through the Software Manager
I attempted to create a new project per http://monodevelop.com/Documentation/Creating_A_Simple_Solution
Unfortunately I receive an error on attempting to build that the filename has not been set. Details of error received are as follows.
System.InvalidOperationException: File name has not been set
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0
at MonoDevelop.Core.Execution.ProcessWrapper.Start () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) MonoDevelop.Core.Execution.ProcessWrapper:Start ()
at MonoDevelop.Platform.GnomePlatform.StartConsoleProcess (System.String command, System.String arguments, System.String workingDirectory, IDictionary`2 environmentVariables, System.String title, Boolean pauseWhenFinished) [0x00000] in <filename unknown>:0
at MonoDevelop.Core.Execution.ProcessService.StartConsoleProcess (System.String command, System.String arguments, System.String workingDirectory, IDictionary`2 environmentVariables, IConsole console, System.EventHandler exited) [0x00000] in <filename unknown>:0
at MonoDevelop.Debugger.Soft.SoftDebuggerEngine+<CreateDebuggerStartInfo>c__AnonStorey1.<>m__6 (System.Diagnostics.ProcessStartInfo info) [0x00000] in <filename unknown>:0
at Mono.Debugger.Soft.VirtualMachineManager.BeginLaunch (System.Diagnostics.ProcessStartInfo info, System.AsyncCallback callback, Mono.Debugger.Soft.LaunchOptions options) [0x00000] in <filename unknown>:0
at Mono.Debugging.Soft.SoftDebuggerSession.StartLaunching (Mono.Debugging.Soft.SoftDebuggerStartInfo dsi) [0x00000] in <filename unknown>:0 at Mono.Debugging.Soft.SoftDebuggerSession.OnRun (Mono.Debugging.Client.DebuggerStartInfo startInfo) [0x00000] in <filename unknown>:0
at Mono.Debugging.Client.DebuggerSession+<Run>c__AnonStorey6.<>m__3 () [0x00000] in <filename unknown>:0
How does one set the filename in Monodevelop?
EDIT: The Build of the project is working , Problem is occurring when attempting to run the application in the IDE
I had the same issue. I found out that if you install xterm, and restart monodevelop the error will be resolved. Apparently xterm is a dependency. Just go to terminal and "sudo apt-get install xterm".

Unhandled Exception while running .exe on mono framework in Ubuntu 13.04

I am using ubuntu 13.04, I installed mono-3.1.2 on Ubuntu-13.04 successfully.
Now i am trying to run C# .exe from windows visual studio.
$ mono WindowsFormsApplication1.exe
I am getting the following :-
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /usr/local/lib/libgdiplus.so
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Drawing.Graphics.FromHdcInternal (IntPtr hdc) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] in <filename unknown>:0
at WindowsFormsApplication1.Program.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /usr/local/lib/libgdiplus.so
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Drawing.Graphics.FromHdcInternal (IntPtr hdc) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] in <filename unknown>:0
at WindowsFormsApplication1.Program.Main () [0x00000] in <filename unknown>:0
How to remove this exception , please help me.
Thanks in advance.
As #knocte pointed out, you should
Install Mono via apt-get such as sudo apt-get install mono-complete, so that libgdiplus is installed as well,
Or compile both libgdiplus and Mono from source code.
raffamaiden's answer worked for me, but there's a small spelling mistake in the answer:
dnf install libgdiplus-devel
I fixed the problem on Fedora 23 by installing libgdiplus-devel as follows:
dnf install libgdiplus-devel

ERROR XmlConfigurator error with Nant on mono 2.8

I tested with simple nant (0.90) on Mac OS X 10.6.4, but I got the following error message.
Even with the error message, I could run nant to get the binary successfully.
What might be wrong?
log4net:ERROR XmlConfigurator: Failed to initialize configuration file watcher for file [/Library/Frameworks/Mono.framework/Versions/2.8/share/NAnt/bin/NAnt.exe.config]
System.DllNotFoundException: libc.dylib
at (wrapper managed-to-native) System.IO.KeventWatcher:kqueue ()
at System.IO.KeventWatcher.GetInstance (IFileWatcher& watcher) [0x00000] in :0
at System.IO.FileSystemWatcher.InitWatcher () [0x00000] in :0
at System.IO.FileSystemWatcher..ctor () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.IO.FileSystemWatcher:.ctor ()
at log4net.Config.XmlConfigurator+ConfigureAndWatchHandler..ctor (ILoggerRepository repository, System.IO.FileInfo configFile) [0x00000] in :0
at log4net.Config.XmlConfigurator+ConfigureAndWatchHandler.StartWatching (ILoggerRepository repository, System.IO.FileInfo configFile) [0x00000] in :0
at log4net.Config.XmlConfigurator.ConfigureAndWatch (ILoggerRepository repository, System.IO.FileInfo configFile) [0x00000] in :0
export DYLD_FALLBACK_LIBRARY_PATH="/usr/lib/:$DYLD_FALLBACK_LIBRARY_PATH" should have been in bash file.