Page 1 of 1

PhidgetSBC2 & Mono

Posted: Fri Feb 11, 2011 3:33 pm
by samuelkadolph
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


Re: PhidgetSBC2 & Mono 101

Posted: Fri Feb 11, 2011 3:33 pm
by samuelkadolph
Reserved for future use.

Re: PhidgetSBC2 & Mono

Posted: Fri Feb 11, 2011 4:58 pm
by Patrick
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

Re: PhidgetSBC2 & Mono

Posted: Thu Mar 31, 2011 1:03 am
by _Dejan_
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.

Re: PhidgetSBC2 & Mono

Posted: Thu Mar 31, 2011 9:54 am
by Patrick
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

Re: PhidgetSBC2 & Mono

Posted: Thu Mar 31, 2011 10:33 am
by _Dejan_
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.

Re: PhidgetSBC2 & Mono

Posted: Thu Mar 31, 2011 1:16 pm
by Patrick
It's not supported in the web interface, but you can certainly set up your own init scripts.

-Patrick