VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Wed Apr 18, 2012 10:11 am

Hi everyone!

Since I'm quite experienced in writing C# applications with Visual Studio I thought it might be nice if I could use those tools with the Pi as well.

There are other development boards out there that allow this kind of programming (e.g. the NetDuino). So it is at least possible.

So my question is: is it possible for the Pi yet? Or are there any projects going on concerning this topic?

Thanks!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24147
Joined: Sat Jul 30, 2011 7:41 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 10:16 am

No, Visual studio will not work on the Raspi - and will never work, it's an x86 application by Microsoft that doesnt run on Linux, never mind Arm Linux.

However, there is an open source version of C# called Mono which we think does work.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
RaTTuS
Posts: 10500
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Visual Studio and C#

Wed Apr 18, 2012 10:17 am

short answer no

longer answer

no but YMMV

VS is a Microsoft product that runs on x86 CPU's so that's not going to work,

however you may get farther with mono
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Wed Apr 18, 2012 10:40 am

eh? Why would I want to run Visual Studio ON the Pi?

I've a quite powerful development machine at home which I would of course use for development. It's the app that I'm developing that should run on the Pi...

With the Netduino things are quite simple: write a C# on your PC, attach the Netduino via USB and hit the run button in VS => The app is transferred to the Netduino, started and can be dubugged as well.

Something similar is hopefully possible with the Pi?

User avatar
teh_orph
Posts: 346
Joined: Mon Jan 30, 2012 2:09 pm
Location: London
Contact: Website

Re: Visual Studio and C#

Wed Apr 18, 2012 11:28 am

Visual Studio supports different remote debugging transports, and can (assuming there's a back-end for the ISA) debug non-x86 embedded code. Perhaps have a hunt for a VS remote debugging stub plug-in? Plenty of people must have wanted to remote debug C# on Linux from Windows...let's hope!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24147
Joined: Sat Jul 30, 2011 7:41 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 11:40 am

VanKurt said:


eh? Why would I want to run Visual Studio ON the Pi?


Because that's what you said in your first post?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Wed Apr 18, 2012 12:07 pm

JamesH said:


VanKurt said:


eh? Why would I want to run Visual Studio ON the Pi?


Because that's what you said in your first post?



Na'ah, I did never say such a thing!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24147
Joined: Sat Jul 30, 2011 7:41 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 12:10 pm

VanKurt said:


JamesH said:


VanKurt said:


eh? Why would I want to run Visual Studio ON the Pi?


Because that's what you said in your first post?


Na'ah, I did never say such a thing!


"Since I'm quite experienced in writing C# applications with Visual Studio I thought it might be nice if I could use those tools with the Pi as well."

I guess that could be read either way. Anyway, to the original (intention) of the question. No way at present, and as far as I know, no-one working on it, to allow VC to write code and send to the Raspi. See teh_orphs post#5
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Wed Apr 18, 2012 12:16 pm

Would it be possible to transfer whatever is installed on the Netduino to the Pi?

I assume there is some basic software to communicate with Visual Studio as well as the .NET compact framework. Since both boards use ARM processors it should be sort of compatible, right?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 12:30 pm

Aren't we all just kinda dancing around in circles here?

I mean, everybody knows that .NET is (for all practical purposes) a Windows-only (*) (and, in fact, MS-only) thing.  Yes, there is Mono, but everybody knows that's a joke.  I think that we will eventually find out that Mono is actually MS-funded: a sinister plot to ward off the monopoly claims against MS.  That is, MS does actually have a legal interest in maintaining the fiction that it has competition.  Plausible deniability, and all that...

Based on what I know about .NET, I find it highly unlikely (**) that a .NET app developed on and for Windows would be anything approaching directly portable (that is, retaining the look-and-feel of the original app) to Linux.  For one thing, the mental model of the Windows GUI is completely different than that of the Unix/Linux "X" GUI.

(*) Yes, insert usual comments about "But, but, but.  Windows runs on ARM" here.

(**) And comments I've seen on various forums back me up on this.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24147
Joined: Sat Jul 30, 2011 7:41 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 12:33 pm

VanKurt said:


Would it be possible to transfer whatever is installed on the Netduino to the Pi?

I assume there is some basic software to communicate with Visual Studio as well as the .NET compact framework. Since both boards use ARM processors it should be sort of compatible, right?


I think it would be easier just to write C# code on the Pi and use Mono to run it.  I think that's how it works. You would need to see if .NET is also part of Mono - if not, you are stuffed.

'Sort of compatible'. No, not really.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Wed Apr 18, 2012 12:41 pm

Joe Schmoe said:

I mean, everybody knows that .NET is (for all practical purposes) a Windows-only (*) (and, in fact, MS-only) thing. 

Not really. As Wikipedia states: "It can run directly "on the metal" without an operating system" (see http://en.wikipedia.org/wiki/......_Framework).

VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Wed Apr 18, 2012 12:42 pm

JamesH said:


VanKurt said:


Would it be possible to transfer whatever is installed on the Netduino to the Pi?

I assume there is some basic software to communicate with Visual Studio as well as the .NET compact framework. Since both boards use ARM processors it should be sort of compatible, right?


I think it would be easier just to write C# code on the Pi and use Mono to run it.  I think that's how it works. You would need to see if .NET is also part of Mono - if not, you are stuffed.

'Sort of compatible'. No, not really.



But that would require to install some sort of operating system on the PI. Wouldn't this mean that the Pi would have to boot before it even executes my application?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 12:42 pm

I did say "For all practical purposes" (to ward off these sorts of claims).
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Wed Apr 18, 2012 12:48 pm

Joe Schmoe said:


I did say "For all practical purposes" (to ward off these sorts of claims).



Are you sure about this? I think the .NET micro framework is an open source community-maintained project, designed to run on small embedded devices. SO it has not much to do with MS or Windows. Or am I understanding something wrong here?

hippy
Posts: 6242
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Visual Studio and C#

Wed Apr 18, 2012 1:06 pm

Joe Schmoe said:

I mean, everybody knows that .NET is (for all practical purposes) a Windows-only (*) (and, in fact, MS-only) thing.
The .Net Micro Framework is already running on ARM architectures.

Providing someone gets the .Net Micro Framework working with the R-Pi there seems no reason it can't be used to run code created in C# using Visual Studio, develop on a PC, download to the R-Pi, just as with NetDuino systems and similar.

GizmoB73
Posts: 80
Joined: Fri Jan 27, 2012 12:51 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 3:55 pm

There's no USB client port on the Pi so that would be a bit different, maybe you could use the Ethernet link, or the serial port on the GPIO?

It would be interesting to see if .Net Framework was written for the Pi.

As part of my day job I have done a lot of .Net code on Windows Mobile PDA's, I am actually enjoying the Pi because it isn't .Net, and look forward to some different coding.

colin B
Posts: 119
Joined: Sun Mar 04, 2012 12:23 pm
Contact: Website

Re: Visual Studio and C#

Wed Apr 18, 2012 9:58 pm

I don't know what would need to be done, but GHI Electronics with their NXP Arm 7 boards use C# as the programming language.

I have their PandaII board but haven't played with it much yet.
On a clear disk one can seek forever

bobc
Posts: 86
Joined: Fri Apr 06, 2012 8:01 am

Re: Visual Studio and C#

Wed Apr 18, 2012 10:34 pm

Well, a joke I used today is "for every job one should use the right tool, and the right tool for every job is a hammer".

.NET Micro framework does not run on the PI, and without support from Broadcom it would have to be quite a crippled version. But Pi runs Linux, why would anyone replace it with .NET Micro framework?

If you really want to run Windows applications on ARM, a Pi does not seem the right tool. Or if you want to run .NET micro, use  .NET micro board. If you want to use the Pi with C#, try mono. The IDE was reasonably usable last time I tried it.

spurious
Posts: 343
Joined: Mon Nov 21, 2011 9:29 pm

Re: Visual Studio and C#

Wed Apr 18, 2012 11:10 pm

SPAM...SPAM...SPAM...SPAM...SPAM...

colin B
Posts: 119
Joined: Sun Mar 04, 2012 12:23 pm
Contact: Website

Re: Visual Studio and C#

Wed Apr 18, 2012 11:24 pm

spurious said:


SPAM...SPAM...SPAM...SPAM...SPAM...


What on earth has school lunches got to do with this topic?
On a clear disk one can seek forever

hippy
Posts: 6242
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Visual Studio and C#

Wed Apr 18, 2012 11:31 pm

bobc said:

But Pi runs Linux, why would anyone replace it with .NET Micro framework?
A better question might be why not, and if people desire to do that then why shouldn't they ?

It has always felt wrong to me to have a computer specifically designed for exploration and the learning of computer sciences pigeon-holed as a mere Linux box.

The R-Pi offers plenty of opportunity for 'because I can' projects and I believe they should all be welcomed and encouraged, whether anyone can see the worth in those project or not.

VanKurt
Posts: 8
Joined: Wed Apr 18, 2012 9:06 am

Re: Visual Studio and C#

Thu Apr 19, 2012 6:03 am

bobc said:

If you really want to run Windows applications on ARM, a Pi does not seem the right tool.
Why does everyone think C# == Windows Application?

C# is just a programming language that can be used on all kinds of operating systems and devices. It is NOT Windows specific!

The reasons why I would like to use it on the Pi are:


Developing with Visual Studio is very efficient and comfortable
So is C# in comparison to lower level languages like C/C++ (performance is not an issue for me)
I would like to have an "instant on" device. By that I mean as soon as I turn on the Pi I want my program to run. Using a linux on the Pi would mean it had to boot first. That's not an option...

Thanks for your replies, guys!

hippy
Posts: 6242
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Visual Studio and C#

Thu Apr 19, 2012 10:22 am

VanKurt said:

I would like to have an "instant on" device. By that I mean as soon as I turn on the Pi I want my program to run. Using a linux on the Pi would mean it had to boot first. That's not an option...
The R-Pi doesn't have ROM / Flash so it's never going to be truly 'instant on', it will have to 'boot' something, but the time to load bare metal code and have that running should be a considerably shorter time than loading a full-blown OS.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24147
Joined: Sat Jul 30, 2011 7:41 pm

Re: Visual Studio and C#

Thu Apr 19, 2012 11:57 am

You need some sort of system in place that can run the C# compiled code (does it compile down to Arm machine code?  I think it still requires an interpretor for the byte code, like Java does), so you would need an OS that is simply a interpretor for your C#byte code. That doesn't exist. You need an OS there on which to run it.

Best bet, rather than turn the Raspi off, hibernate it. Takes very little power in that state and woudl start up faster. Not sure anyone has done any work yet on hibernation.

As to the performance, I think you will struggle getting much performance out of it. I don't think .NET has been run on anything of this relatively low speed - I think it was only developed after the era of P3 chips. Could be wrong.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Return to “Beginners”