MonoDevelop 5.0 for Linux Distro? - c#

According to the official website, Mono now supports System.Speech (in 5.0) . However, I am unable to reach a linux build of version 5.0
"Packages for MonoDevelop 5.0.0.878 not yet available. The latest available version is MonoDevelop 4.2.1"
Is there any way of achieving this? (tarballs, git?)
Notes
I am using ArchLinux

The best way to use the last monodevelop on Linux is to get it from git (it's very fast and very easy :)
Now I'm using it (5.1) on Ubuntu 14.04.
You can get the source code from here:
git clone git://github.com/mono/monodevelop.git
and then compile it: http://monodevelop.com/developers/building_monodevelop
Remember that you must have installed Mono runtime 3.x.

I am answering this a little earlier but i think it applies right now too because Xamarin have already provided Mono 3.6.0 builds(technical preview) for Debian and derivatives.And with in a few months the best way to get anything latest related to mono will be from Xamarin official builds.They will provide Mono and some important applications including Monodevelop for every Debian and Centos derived Linux distributions.
See this link......
mono builds for many Linux distributions

Having just built Monodevelop the hard way, I would recommend downloading a tarball from http://download.mono-project.com/sources/monodevelop/ as everything is already included and requires no additional downloads except the some apt-get installs.
If you really want to use the git repo here is how to fix the two major issues I had.
1) I'm behind a proxy so I had to edit git module files to not use the git protocol as described in this post https://stackoverflow.com/a/11410074/1516326
2) You have to Import the Mozilla LXR certificates for Mono, so NuGet can update correctly, using:
mozroots --import --sync
For the entire process follow these instructions: http://www.monodevelop.com/developers/building-monodevelop/

Related

Linux: Mono installation and errors

Over the past weeks I struggled to get a working Mono installation without success.
I have tried it on Debian6_x64, Debian7_x64 and Ubuntu_12.04_x64.
I have installed it using the default mono-complete using apt-get, tried compiling it from GitHub and from alternative repositories. Either with Mono 2.x or 3.x, I followed several tutorials and nothing seems to work.
Unfortunately I don't have the error logs of past installs but at this moment my current situation is:
Ubuntu 12.04 x64
Mono JIT compiler version 3.4.0 (master/250756b Sun Mar 2 15:02:07 EST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
I'm trying to run a c# program I compiled under windows and the error I get currently is:
user#host:/home/pck# mono Program.exe
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/usr/local/lib/mono/4.5/mscorlib.dll' directory.
I've been googling and nothing seems to work. I'd greatly appreciate any advice that could help.
Thanks!
The best thing to do nowadays is install Ubuntu Trusty 14.04 (LTS), which includes mono 3.2.8 in its default repositories (easy to install through apt-get).
It's not automatically granted that a C# application developed under Windows will work under Linux, using Mono libraries.
This depends on:
The libraries used to develop the application under Windows. As far as I know, for example, the libraries used in WPF have no compatibility in Mono. Have a look at this page to check the compatibility of your application.
The version of Mono installed. Each version introduces fixes, enhancements and support for new libraries. This means that your program will not work without any problem and you could encounter some errors.
About your issue, it seems that your application expects to find the libraries related to .NET Framework 4.5, but they're not installed. Install the correct version that supports them. Make sure your application doesn't use specific features of Windows platform. In that case, you will have to remove them.
There's a missing file in the mono 3.4 tarball that causes make install to fail right after it installed the 2.0 binaries. The other versions never get insalled, which is why you are missing 4.5
cd to the unpacked tarball and create the file yourself:
cd */path/to/unpacked*
echo -e '<Project xmlns=<a class="moz-txt-link-rfc2396E" href="http://schemas.microsoft.com/developer/msbuild/2003">"http://schemas.microsoft.com/developer/msbuild/2003">\n <Import Project="..\Microsoft.Portable.Core.props" />\n <Import Project="..\Microsoft.Portable.Core.targets" />\n</Project>' > mcs/tools/xbuild/targets/Microsoft.Portable.Common.targets
and then continue as usual (not sure if you have to configure and make again)
./configure --prefix=/opt/mono-3.4
make
make install
What have you done to implement portable code? Are you sure you have no platform-dependencies? Implement a one-liner:
System.Console.WriteLine("OK!");
Remove all unnecessary dependencies and use framework 2.0 (most stable).
If that works, the problem is not the Mono installation on Linux but something in your code.
The problem is your mono files are installed in /usr/lib/mono but it is looking for them in /usr/local/lib/mono which doesn't exist.
Copying the whole directory /usr/lib/mono to /usr/local/lib got it working for me.
This set of instructions (not the Ubuntu ones) worked for me in Ubuntu 12.04, I think.
I also cloned from github and followed their ./autogen.sh; make; make install; make check instructions just in case.

Mono + OS X: "No package 'cocoa-sharp' found"

I have recently installed Mono and MonoDevelop on Mac OS X, and now I am trying to create a native C# app for Mac. I tried following the Mono tutorial to create this double-clickable "app", but got stuck. My specific error was "no package 'cocoa-sharp' found" when I tried implementing the commands outlined in the documentation.
I searched SO and found others who were reporting missing the 'cocoa-sharp' package. The advice given in a thread over 3 years ago was to reinstall Mono. What happens when that does not work? Can I go get 'cocoa-sharp.pc' or whatever the specific file is and throw it into a particular directory manually? Am I even going down the right path?
The command I used:
gmcs test.cs -pkg:cocoa-sharp
cocoa-sharp is obsolete and the tutorial is outdated, but thankfully there is a good replacement: MonoMac. You can fetch and compile it from within MonoDevelop (provided you have installed XCode), and there are lots of examples in the samples/ directory. There is even integration with the XCode interface designer.
Just recently there was a successor to MonoMac announced, which is however a commercial product: Xamarin.Mac.

How to port a Mono GTK# app to other platforms?

I am working on a Mono GTK# desktop app written in C#. I have developed my app using the MonoDevelop IDE (v2.4.2) on a Mac (OS X v10.6.7). My app depends on the GTK# library (obviously) as well as the Mono.WebServer2 library for running a local ASP.NET server.
I have tested my app on my own Mac as well as other Macs. Everything is working out great. Now, I am interested in porting my app to other platforms (specifically, Windows 7 and Ubuntu v11.04). I have been playing around with the mkbundle command but I haven't had any luck in creating a working bundle for other platforms than Mac OS X.
Since I have tried a number of different solutions without success, I would like to hear from the Mono developers out there. What do you do to port your app to other platforms?
I have been developing C# using Visual Studio for a long time but I am new to the Mono development environment. Therefore, I would very much appreciate a detailed explanation.
Thank you very much!
It doesn't really sound like you're talking about porting, rather packaging. MonoDevelop's "Project/Create Package" function can create simple binary packages (zips etc) or source packages (source plus makefiles) but these are not the ideal form to distribute to most end-users. Some additional work is required to make a polished installer for each platform.
mkbundle bundles the Mono runtime into your app, therefore it creates binaries that are 100% platform-specific.
For Mac, the usual way to distribute an app is as an app bundle. MonoDevelop doesn't automate this for GTK# projects, but I explained how to do it on my blog.
For Ubuntu, you can distribute a zip of binaries and require that your users install Mono, GTK# and xsp. If you create a .deb package, you can embed these dependencies into the package manifest. MonoDevelop doesn't have any tools for creating deb/rpm linux packages, and I'm not familiar with the process myself.
For Windows, you can provide a zip of binaries and require that your users install .NET and GTK# for .NET. You could also create a msi installer and have it check for these prerequisites.
It sounds like you have already solved the problem of packaging for Mac.
On Ubuntu, you would want to create a .deb package that contains your app and requires other packages as dependencies (Mono, Mono.WebServer2, GTK#, GTK+, etc). The following link should get you started on building Ubuntu packages:
https://wiki.ubuntu.com/UbuntuDevelopment
For Windows, you probably already know how to build an installer if you have .NET experience. I would say that you would want to run your app on top of .NET instead of Mono. That is what the Mono team do themselves (for MonoDevelop as an example). Bring in the Mono specific bits like Mono.WebServer2 as part of your application.
Your biggest issue here will be that GTK# requires the GTK+ C libraries to be installed. Probably the easiest thing is to detect if GTK# is installed as part of the installer and ask your users to install GTK# if they need it. You are going to have to do the same detection for the .NET version you require anyway. You can get GTK# for Windows here.
I do not have great instructions for doing this but both the Banshee and MonoDevelop projects do it well. I would take a look at those projects as they will show you exactly what needs to be done.
https://github.com/mono/monodevelop
http://git.gnome.org/browse/banshee
EDIT:
I just recently realized that the code for the GTK# installer is on GitHub here.
There are is also packaging projects available in Monodevelop. you can use them.
I'm doubtful that mkbundle work well other than Linux.
Another option that open your project on other plateform (you can use Monodevelop) and build the project and use some other app to build package.
I just recently created deb package of my own .Net project written in MonoDevelop. From MonoDevelop I created a package with sources and makefiles (makefiles also generated by MonoDevelop) and then i used this guide>
http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html
to create deb package. Dependencies were mono-runtime and gtk-sharp2.

MonoDevelop in windows

Is there a version of Monodevelop that runs on Windows? If so where can I get it?
MonoDevelop officially supports Windows since 2.2. You can check the what's new in Monodevelop 2.2 or download the last release.
Windows Support
Windows now Officially Supported
Windows is now an officially supported
platform for running MonoDevelop. Many
Windows specific issues have been
fixed, and some add-ins such as
debugging and subversion support have
been written specifically for Windows.
Windows Installer
We are releasing a new Windows
Installer which includes almost all
you need to run MonoDevelop. The only
external dependency is gtk#, which is
provided in a separate installer.
It looks like you can build it and run it on Windows, but I don't think there is a binary download available yet. From the docs, here:
Does MonoDevelop work on Windows?
Yes. MonoDevelop can be built and run
on Mono on Windows, although it is
still unstable and some features may
not be available. We are currently
working on a Windows installer that
will be soon be available.
There are no precompiled binaries, so you'd have to build from source. Even then, there seems to be some stability issues running MonoDevelop on Windows (see here).
Some alternatives would be SharpDevelop and/or Visual Studio Express.
Update: MonoDevelop version 2.2 and higher officially supports Windows. You can get the latest version here: http://monodevelop.com/Download
There is currently no official release of Monodevelop for windows. After researching it a little bit, it seems that MonoDevelop was started as a port of SharpDevelop which is an open source .Net IDE for windows. Perhaps you may want to look into SharpDevelop and see if it meets your needs.
You can find out more information at the SharpDevelop website:
http://www.icsharpcode.net/OpenSource/SD/
You can specifically target the Mono framework when writing apps in SharpDevelop (something you can't do with Visual Studio Express). I should have pointed this out in my answer above. From the website:
SharpDevelop has the ability to
compile your code against previous
versions of Microsoft's .NET
Framework, Microsoft's Compact
Framework or Mono (an open source
implementation of the .NET Framework
sponsored by Novell) if they are
installed.
The easiest way now to get MonoDevelop is running openSUSE Linux under VirtualBox. It's really no so hard. You will get "real" linux system with Mono & MonoDevelop running on it without any issues. Hope this helps.
There is not currently binaries available for MonoDevelop for Windows. This is because it has not been tested and is extremely buggy. Ie: you will probably not get more a minute or two of use before it crashes. Hopefully with MD 2.0 now out, this is something we will soon have time to address.
Note that you do not need MonoDevelop to use Mono. You can use the same binaries produced from Visual Studio or SharpDevelop on Mono.

What the best setup latest Mono + MonoDevelop on Ubuntu 9.04?

I start using Ubuntu 9.04 on my laptop. What I really want is to be able to write my C# projects on Ubuntu, including unit testing. Could anyone guide me how to setup it?
In addition to the basic packages Matthew suggested, you'll also want the monodevelop-nunit package, which allows you to run and debug unit tests from within the IDE. For the debugger, you'll want monodevelop-debugger-mdb. You probably also want monodevelop-versioncontrol for SVN support, mono-xsp2 for running ASP.NET apps, and monodoc-browser for the docs viewer.
Maybe you're best off just installing all of the packages 'suggested' by the MonoDevelop package -- I believe the Ubuntu package manager has a way to do this easily from its GUI.
Beware that Ubuntu splits up Mono into many, many small packages, so if something's missing, use the apt-file tool or similar to find which package you need to install.
Ubuntu doesn't have Mono 2.4 packages yet; if you require 100% up-to-date packages, your best bet is to use openSUSE. The only way to get 2.4 on Ubuntu right now is to build from source -- and if you decide to do that, please read How not to break Mono installations first.
You probably already updated to 10.04 in the meanwhile. For 10.04 (and 8.04) you can use the badgerports. I didn't try it (yet), but it looks reliable.
I would suggest using 2.4 as it has all the latest .net goodness.
There are two guides I would suggest using:
http://blog.ruski.co.za/page/Install-Mono-on-Ubuntu.aspx
http://www.centriment.com/2009/04/01/building-mono-24-from-source-on-ubuntu-810/
The latter lets you keep the mono install that comes with ubuntu so you can still install apps from synaptic. I would suggest using this. Both guides however are really clear about what is required to install it. It looks menacing at first but if you take a couple of hours to follow it then you will see it is actually quite easy.
Good luck
EDIT: Added mono-devel
I use Ubuntu 8.04, but what do you really need to setup? Doing (if you haven't already):
sudo apt-get install monodevelop nunit mono-devel
should give you what you need. And there are plenty of tutorials for both monodevelop (e.g. http://monodevelop.com/Documentation/Creating_A_Simple_Solution) and NUnit (e.g. http://www.nunit.org/index.php?p=quickStart&r=2.4.8)

Categories

Resources