PhidgetSBC2 & Mono

General PhidgetSBC Discussion.
samuelkadolph
Phidgetsian
Posts: 14
Joined: Mon Jan 24, 2011 11:15 am
Contact:

PhidgetSBC2 & Mono

Postby samuelkadolph » Fri Feb 11, 2011 3:33 pm

Since I love using C# and the PhidgetSBC2 can make use of Mono I decided to get one and use Mono with it. I felt it would be of benefit to document my adventures.

I've planned 5 blog posts to get started with and hope to make more as I use my PhidgetSBC2 more and in response to discussion here.


Blog Posts

Last edited by samuelkadolph on Tue Feb 22, 2011 1:44 pm, edited 2 times in total.

samuelkadolph
Phidgetsian
Posts: 14
Joined: Mon Jan 24, 2011 11:15 am
Contact:

Re: PhidgetSBC2 & Mono 101

Postby samuelkadolph » Fri Feb 11, 2011 3:33 pm

Reserved for future use.

User avatar
Patrick
Lead Developer
Posts: 3047
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: PhidgetSBC2 & Mono

Postby Patrick » Fri Feb 11, 2011 4:58 pm

Awesome!

We actually meant to include official support for Mono - as per the Java support, but decided to push this into a future update to get the SBC2 released sooner.

I'm glad to see that everything is working.

I expect to create a .deb for the phidget21 .NET library and add this to our Debian repository in the future, so that part of the install at least will be simplified.

-Patrick

_Dejan_

Re: PhidgetSBC2 & Mono

Postby _Dejan_ » Thu Mar 31, 2011 1:03 am

Hi,
I have few questions about runing Mono on SBC2. Im new to Mono and Im never try it before now. Im make some applications and dll's in C# (.NET 2.0 and .NET 3.5) and I know C# more than Java so Im decide to upgrade hardvare from SBC to SBC2 and make project in Mono...
Im install Mono by your procedure in "Using Mono on the PhidgetSBC2" but Im use latest library ...
Im try run Phidget example with command:

Code: Select all

gmcs Example.cs -r:Phidget21.NET.dll && mono Example.exe

and it run ok.

Im install library dll into GAC with command:

Code: Select all

gacutil -i Phidget21.NET.dll
ln -s /usr/lib/mono/gac/Phidget21.NET/*/* /usr/lib/mono/2.0/Phidget21.NET.dll

but when I try compile demo with command:

Code: Select all

gmcs Example.cs

I get error that it can't find namespace "Phidgets":

Code: Select all

root@phidgetsbc:~# gmcs Example.cs
Example.cs(2,7): error CS0246: The type or namespace name `Phidgets' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 1 error(s), 0 warnings


If I run:

Code: Select all

gacutil -l

I get:

Code: Select all

root@phidgetsbc:~# gacutil -l
The following assemblies are installed into the GAC:
CustomMarshalers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
Phidget21.NET, Version=2.1.8.42, Culture=neutral, PublicKeyToken=c2b1f2a3594bce52
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Number of items = 16

Can you tell me what I do wrong?
Thanks for any help.

User avatar
Patrick
Lead Developer
Posts: 3047
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: PhidgetSBC2 & Mono

Postby Patrick » Thu Mar 31, 2011 9:54 am

I not exactly sure, but I imagine you still need to reference phidget21.net.dll when you compile you .cs files - the GAC libraries are used when you run your program, not when you compile it.

-Patrick

_Dejan_

Re: PhidgetSBC2 & Mono

Postby _Dejan_ » Thu Mar 31, 2011 10:33 am

Patrick wrote:I not exactly sure, but I imagine you still need to reference phidget21.net.dll when you compile you .cs files - the GAC libraries are used when you run your program, not when you compile it.

-Patrick


Hi Patrick,
It is not big deal because Im configure Visual Studio 2010 that can build app for Mono and then I only copy it to SBC2 and run it with:

Code: Select all

# mono Application.exe


Im not shure but Is possible setup SBC2 in web gui in "Projects" tab that automatic run mono applications? If not can this be somehow done(I don't need java so I can edit/replace some script which run java applications)?

Thanks.

User avatar
Patrick
Lead Developer
Posts: 3047
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: PhidgetSBC2 & Mono

Postby Patrick » Thu Mar 31, 2011 1:16 pm

It's not supported in the web interface, but you can certainly set up your own init scripts.

-Patrick


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest