Page 1 of 1

existing Visual C# 2010 app - will this work on Win10 IoT?

Posted: Mon Jul 06, 2015 9:18 am
by yesyes
Hi!
I have developed an application on Visual Studio Express 2010 in C# using .NET 4 and Windows Forms.
Basically it is the packet router of my own home automation project. It is currently running fine on Windows 7 24/7. There are several USB-to-serial port adapters connected to this machine and the app accesses these through virtual COM ports. The app routes data packets between these COM ports and other endpoints over IP (UDP, local network only). The app is multi-threaded and uses my own DLLs (for different types of communication ports).

Now, when I heard about Win 10 will run on the Rpi2 I was very excited (even more so when I heard MS provide it free of charge). My first thought was that I would be able to run this app on an Rpi2 and save a lot of electricity not having to run it on a "normal" Windows machine. The app doesn't need a lot of processing power.

Now that the Win 10 IoT preview is available I bought an Rpi2 and wanted to try this out. I started reading up on it a bit more and started to realise that this isn't going to be a full Win 10. But information is very scattered and hard to find. I couldn't find any information whether .NET will be supported (all I found was a comment somewhere saying that ASP.NET might be supported in future). So called Universal Apps seem to be the new thing but again I could not find info on whether old C# apps can be ported.

So before I dive into this I would appreciate a few infos from people who have looked into this in much more detail than I have so far.

- Will .NET 4 WinForms apps work on Win10 IoT? If yes, this would be the ideal situation as I could just run the existing app.
- Failing that, can I just re-compile my existing app on Visual Studio 2015 and make it an Universal App?
- Will it then still work on Win 7? Or do I need to maintain 2 projects/versions for that?

I would also like to note that I'm not a professional coder. I taught myself C# mainly for this one project.

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 12:46 pm
by UndergroundFun
As far as I know you'd need to re-create it on VS 2015 as a universal app and deploy it from there. You can't run a winform application. But I'd think most of your non-UI code should be portable.

I'm not sure what issues you might run into trying to access connected devices like that, it's not something I've messed with yet.

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 1:01 pm
by fruitoftheloom

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 1:54 pm
by yesyes
Thanks, but this is for Windows 10, not the IoT version. So this doesn't really apply, I'm afraid.

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 1:59 pm
by yesyes
UndergroundFun wrote:You can't run a winform application.
That's a shame if true. More than half of the development effort (not necessarily number of lines of code) went into the UI. I really wouldn't want to re-do all of that just to save a few watts by using an Rpi.

It might be best for me to wait for the official release and see what features they packed into it...

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 2:00 pm
by fruitoftheloom
yesyes wrote:
Thanks, but this is for Windows 10, not the IoT version. So this doesn't really apply, I'm afraid.
I posted this because it has links to other resources regarding Universal Apps ;)

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 3:45 pm
by yesyes
fruitoftheloom wrote:I posted this because it has links to other resources regarding Universal Apps ;)
Ah, OK. I'll have another look. Thanks!

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 3:46 pm
by RST8
yesyes wrote:
UndergroundFun wrote:You can't run a winform application.
That's a shame if true. More than half of the development effort (not necessarily number of lines of code) went into the UI. I really wouldn't want to re-do all of that just to save a few watts by using an Rpi.

It might be best for me to wait for the official release and see what features they packed into it...
There is no desktop on the IOT version, so Winform apps are not going to run. One of the things about the IOT version is that the GUI, be it Web or classic Win32 / winforms, is running elsewhere and from the MS perspective ideally somewhere on Azure, there's a reason that the IOT part is "free".

Mono might be an option, but the amount of effort required is going to be significant, if it works at all.
If you want lower power x86, then there are boards that do this, but they tend to cost more than the Pi and you probably aren't going to save enough electricity to warrant the cost.

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 3:49 pm
by yesyes
Researching this some more I've come across another option. It seems MS are open-sourcing .NET and bring it to Linux and Mac. So I could wait for that to happen and then run my existing app on Linux. I have actually tried running it on the Rpi on mono but the UI was really slow and I couldn't figure out how to use the virtual serial ports on Linux.

But that is now slightly off-topic in this section...

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 4:12 pm
by yesyes
RST8 wrote: There is no desktop on the IOT version, so Winform apps are not going to run. One of the things about the IOT version is that the GUI, be it Web or classic Win32 / winforms, is running elsewhere and from the MS perspective ideally somewhere on Azure, there's a reason that the IOT part is "free".

Mono might be an option, but the amount of effort required is going to be significant, if it works at all.
If you want lower power x86, then there are boards that do this, but they tend to cost more than the Pi and you probably aren't going to save enough electricity to warrant the cost.
That's interesting. I had not seen this mentioned anywhere else that the UI is not running on the Rpi. I've seen some sample apps where it appeared that the UI was actually running on the Rpi. I know it has no desktop as such but I thought one UI app can run on the Rpi directly.

I will certainly not have this connected to any cloud. One of the main objectives of my own home automation system is that no data leaves the house and be analysed by who-knows-who.

This question was actually about a second "node" in my system. The main server is running in the house on Win7. That needs some more power as it also needs a web server and database (I access the system via browser on my phones / PCs). There is an "outbuilding" that now also has home automation devices and I need another instance of my software (not the web server) to route packets between the main server and that building. This is where I was thinking of using the Rpi. I currently use a Gigabyte BRIX machine with a low power Celeron CPU (4.5Watt TDP CPU, the whole thing uses about 10-15Watt). So there really isn't a lot of electricity I can save. Maybe I should just leave it like that.

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 4:21 pm
by PiGraham
I think you can indeed run an interactive GUI on the Pi under Win10 IoT.

Here is an example
https://www.youtube.com/watch?v=O1xGr0rfxoc
Peter Oakes wrote:Hi everyone, there has been a lot of speculation as to the functionality of Windows 10 on the PI2

This has focused initially on the fact it wont have a GUI display and be well rather none eventful

Well I have been playing around with this for the last couple of days and I have to say

HOW WRONG THAT THOUGHT IS !

The Windows 10 for IOT on the Raspberry PI does not have a GUI console sure. BUT it does have a GUI display, just waiting to be tapped into

In this post I will take you through basic setup of the PC and the PI, getting Windows 10 Technical preview to talk to the PI and also using Visual Studio 2015 Community Edition up and running with your first apps

Re: existing Visual C# 2010 app - will this work on Win10 Io

Posted: Mon Jul 06, 2015 6:17 pm
by haroldpulcher
Windows IoT has the capability of running universal apps and having a xaml based ui. Classic Winforms will not work, but if you app is WPF based converting it to a Universal app should get you there.

The only problem being that there can be only one app with a UI running at a time.