C# in Linux using Mono

Hi,
I am new to Linux. We are developing a new product using Colibri iMX6 DL 512MB. I am testing the board with Colibri Evaluation board. For GUI we started with gtk with eclipse. But it is getting complex. So we are thinking of alternatives to gtk and eclipse IDE.
This post here, shows that there is a way to use Mono to build C# applications.
But when I tried to setup mono on the device, the following command was not accepted.

opkg install mono mono-dev ca-certificates openssl

Think that the default Linux OS supported by Toradex is not supporting Mono. I tried making a custom image after reading this post. I ran into errors. Pls Check the error log file.link text. Any guess where I went wrong.

Since we are new to Linux and Yocto, any resources/documents on creating custom Linux images other than the two Toradex Yocto webinars (already watched it) in Youtube would be much helpful.

Thank You for your time. … …

hi @goofy and Welcome to the Toradex Community!

Could you provide the version of the hardware and software of your module? Which carrier board are you using?

But when I tried to setup mono on the device, the following command was not accepted.

Could you share the error log?

Think that the default Linux OS supported by Toradex is not supporting Mono.

Usually you can install mono out of box.

I ran into errors. Pls Check the error log file.link text. Any guess where I went wrong.

Could you share the complete log? Please try also these solutions to solve the build issue.

Since we are new to Linux and Yocto, any resources/documents on creating custom Linux images other than the two Toradex Yocto webinars (already watched it) in Youtube would be much helpful.

Sure, please have a look here.
Regarding mono, there are two solutions which are discussed in this community post.

Best regards,
Jaski

Hardware Used:

  1. Colibri iMX6 DualLite 512MB V1.1A
  2. Colibri Evaluation Board V3.2B

OS : Colibri-iMX6_LXDE-Image-Tezi_2.8b6.184

Error reply for installing mono using the command ,

opkg install mono mono-dev
ca-certificates openssl

opkg_prepare_url_for_install: Couldn`t
find anything to satisfy ‘mono’

If making a custom image will help installing mono, kindly guide me through the process of adding a layer into Linux source code.

This link shows how to add a layer into Linux . It asks to put a layer version like META_JAVA=f5f49c8fd63d6d38938972841759006c69afcc15

And since I have to do the same for installing Mono, which I learnt from here, I am not sure about the layer version. Whether it is a random value or it depends on the layer recipes.
The meta-mono layer is present in this link.

Does adding this layer by this command “git clone git://git.yoctoproject.org/meta-mono” ,
adding meta-mono layer to bblayer.conf
And bitbake the mono layer using “bitbake -k core-image-mono” , include mono into linux?

Sry. I don’t have the complete error log. I’ll bitbake it once again after some modifications and include the complete error log, if error occurs.

And Thank you for the link on OE core. But I have already read it. We have used Toradex with WinCE before and since we are completely new to Linux, any articles/resources on Yocto project and OE core not specific to Toradex would give us some deep understanding. Hope so.

Thank you for your time . … …

hi @goofy

opkg_prepare_url_for_install: Couldn`t find anything to satisfy ‘mono’

Have you done opkg update before? Is the module connected to Internet?
I tried this out on my side and it is working perfectly fine.

If making a custom image will help installing mono, kindly guide me through the process of adding a layer into Linux source code.

You need to add this layer to the bblayers.conf and add Sry. I don’t have the complete error log. I’ll bitbake it once again after some modifications and include the complete error log, if error occurs.

There is no issue. You can send the error log once you got it.

And Thank you for the link on OE core. But I have already read it. We have used Toradex with WinCE before and since we are completely new to Linux, any articles/resources on Yocto project and OE core not specific to Toradex would give us some deep understanding. Hope so.

You are welcome. For yocto project, you can read this manual here.

Thank you for your time . … …

You are welcome.

Best regards,
Jaski

Hi Jaski,
Installing Mono into the device worked. I had some problem with internet earlier. Now I have installed Mono.
Now if i develop a form application in the host computer and generate an .exe file, will it execute on the Toradex board?
I followed this link. But it not very clear to understand. It says,

Transfer the compiled C# example
application to the device. Start the
Device Explorer application on your
host machine. Execute the C# example
application (i.e.
DeviceClientHttpSample.exe) on the
device using Mono

Couldn’t figure out what’s a Device Explorer.
And do I need a cross compiler to compile the C# application that I develop on the host ubuntu PC to make it work in Toradex?

hi @goofy

These are good news.

Now if i develop a form application in the host computer and generate an .exe file, will it execute on the Toradex board?

I would suggest you to create a simple “Hello World Application” on your host and run this on the module. This should work without any cross compilation on the module.

Couldn’t figure out what’s a Device Explorer.

This is a Tool, which is only useful, if you want to develop IoT app using Azure cloud as backend.

And do I need a cross compiler to compile the C# application that I develop on the host ubuntu PC to make it work in Toradex?

Only if you need specific C libraries for your code.

Best regards,
Jaski