I have developed a window forms application using visual studio 2017.
Now I want to install this window forms application on Mac os.
Please help in this connection. What easy possible way to do.
Thanks
If you have a complete app in WinForms on .NET Framework, you could try porting it to Mono, which is .NET Framework implementation for Linux and MacOS. You can check out this link.
It's a completely different story if you're running .NET Core. In that case I would suggest creating web UI in ASP.NET Core. Or if you're familiar with one of UI frameworks compatible with MacOS (e.g. Qml.Net or AvaloniaUI), build the frontend in it.
Hello, First at all winform are designed to run on windows only(BTW is really old technology of creating desktop application using C#). Much better approach is to use WPF.
In case of You want run Your application on different platforms is much better to use WPF on .NET CORE. The same application You can easy run on:
Windows, Mac OS, Linux
I hope this can help You.
Related
I neeed to run a windows form application on Raspberry Pi made using C#.
I have tried the option of installing a windows os and running the exe application . It does work but the issue is that it is slow and takes a lot of time for the application to work.
Is there any possibility to run the exe directly on raspbian ?
You can't natively run winform applications under Linux, but maybe you could try using Wine or one of the other compatibility tools for Linux.
If you are the author of the application you could port your app to GTK# which is a desktop GUI Toolkit for Linux with C#
What I'm using right now:
You can execute Windows Forms Applications written in the .NET Framework (newest 4.8, no longer continued) with mono.
On the raspberry pi, if I recall correctly, you can "sudo apt install mono-complete" and then run it via the terminal: "mono YourApp.exe"
As I said, it sadly only works with .NET Framework Applications (or maybe on rare occasions with .NET 6.0 too, hasn't worked for mine though), you may be able to change that in Visual Studio though (or new project and then copy/paste the code).
The only downside is that you are then using an older version of C#, meaning some things may be different from what you are used to.
I am a newbie at c# programming. I would like to know the basic difference between gtk and winform applications..
Actually, I am a linux user. My OS doesn't support Visual Studio community. So, it will be a great help, if you would like to know whether I should use VM and download visual studio community on it or use gtk form on monodevelop instead of winform.
And also, I would like to know if the code of gtk and winform are same or not.
Can I be able to run gtk type project on windows ? Thanks in advance..
WinForms is a GUI toolkit API designed by Microsoft for .NET and is implemented on top of native Windows APIs and Windows controls. The Mono project made a cross platform implementation of the WinForms APIs (a port) that can run on all widely used desktop operating systems (Linux / Windows / MacOS). I have never used MonoDevelop but I have heard that it is actually very good, you should give it a try!
Gtk is an open source, cross platform GUI toolkit (Linux / Windows / MacOS). It is usable from many languages thanks to the numerous language bindings available. For C# language there is Gtk#. Like Mono it also has an active community where you can ask questions https://discourse.gnome.org/c/platform
To decide you can read here: https://www.mono-project.com/docs/gui/
I have windows 8.1 64 bit with visual studio 2013. But I want to develop C# application which will run on all Windows operating system xp,vista,7,8,8.1 32bit&64bit.
Is it possible to develop universal C# application for 32&64 bit xp,vista,7,8,8.1 OS.???
As pointed out in the comments, you can use .NET 4.0 to do this, and compile with Any CPU. Don't use 4.5 or later, as it's not supported on Windows XP.
You can even back-target your app all the way to the 2.0 runtime if you have a very simple application and you want to have the widest availability without having to install a later version of the .NET Framework on old machines. You give up a lot when you do this, though. I recommend just targeting 4.0 and being done with it.
I have years of experience developing on microsoft development stack primarily visual studio 2012/c#. But right now, im required to develop app on linux. While i know c++, its been years since i really touch that. I have few questions.
Can i develop using mono and compile binary for linux and windows with no code(or minimal) code changes?
Can i develop on windows platform using visual studio 2012, compile for linux on window platform? do i need to use virtual machine for compiling for linux in windows platform?
How do you setup your development environment if you want to develop linux app on windows platform(develop on windows, compile for linux and windows. my linux box use for testing is a separate machine.)
Some info on what im working on.
My project is about network channel analysis. The client is cheap industrial linux box most probably with no ui. Im using mono/c# to develop the client. The server would be windows develop using vs2012 c#. Most probably using wpf as ui. Im planning to share network/communication library between linux(client) and windows(server). My primary concern for using linux is for cost saving since the client is almost thousand units.
thank you.
Mono runs executables in PE (Portable Executable) format, the native file format of Windows. There's no need to "compile for Linux", as long as your app is pure MSIL. And even if you use native DLLs through p/invoke, Mono and Wine work together to run the Windows files on Linux.
(The a.out and ELF executable formats used by native Linux applications don't have mechanisms for storing .NET metadata, the PE format was modified to support .NET, so that's what .NET Framework (not Micro Framework) implementations use regardless of platform)
The most important things to consider at the beginning are,
WinForms of Mono is problematic. Not only most third party controls won't work properly, but also libgdiplus itself is not 100% compatible with Microsoft's GDI+. It might appear to be a sweet option, but later you might still need to fight hard against the incompatibilities.
WPF is not an option as Mono does not support it yet.
GTK# is your best choice for UI, which blends naturally with Linux distros. If you refactor your Windows project properly, you should be able to share the non-UI code between your Windows and Linux solutions. This is what Mono guys recommend (not only use native UI frameworks for Windows, Linux, but also for Mac/MonoMac, iOS/Xamarin.iOS, and Android/Xamarin.Android).
So go back to your questions,
You should never wish for no code change for a real world project. No, that's impossible. As I said earlier, you have a chance to share most non-UI portion.
You can develop the non-UI portion and the Windows only portion using VS2012 and test them out on Windows. If you plan to use Mono's WinForms or GTK#, you must develop and debug on Linux using MonoDevelop. Thus, you need either a virtual machine or physical machine of Linux.
For me, I frequently switch between Linux/MonoDevelop and Windows/VS.
As Mono + C# is much more productive than using C/C++, many successful Linux apps are developed on Mono, such as Banshee and Tomboy.
You can use Visual Studio without problems but for example you cannot use WPF, while Windows Forms are ok. For more information what you can use visit: http://www.mono-project.com/Compatibility
Moreover there exists Mono tools which integrates with VS: http://www.mono-project.com/GettingStartedWithMonoTools
What I want to know is what is the easiest way to get a GTK# app running on Windows.
I want to develop in Ubuntu and then make installers for people who are running windows so they can just use my apps straight away..
Do I need to somehow bundle Mono into the installer.. maybe GTK# too..
This seems like a bit of a nightmare..
So yeah just the easiest way for me to be able to develop in monodevelop and then give people my apps without them having to do loads of tricks to make them work.
As long as you do not use Mono specifics libraries and P/Invoke your application should run out of the box on a windows system - assuming the .NET framework is available.
Concerning how you want to ship your application and the dependencies, especially GTK#, I advise you to have a look at this question : Deploy gtk sharp applications to windows without installing gtk. Multiple techniques are described, one of them will probably fulfill your requirements.
Install Visual C++ 2013 redistributable package x86 and gtk# for .net.