Windows Forms C# Pot To Mac OS X (easiest way) - c#

Been searching the web and stackoverflow for 3 days, and I can't find an answer for what I need. I am a C# developer, not a Pro one but I am pretty good with developing Windows (desktop) software.
Now I want to port a windows software to Mac, but I simply can't find a guide on how to do this.
I installed VS coomunity 2015 with xamarin, but I didn't find any tutorials or guide on how to port a desktop software to mac os X (not to ios/windows phone).
I know that using Mono will help do that, but I simply have no clue where to start. I installed vmware with elcapitan, have everything set-up but I have no clue what to do next.
So knowing that I developed a C# .net app, that uses only the default .net libs that are supported in MONO, what should I do to port it on mac os X?
How can I compile in VS 2015 and simply run on Mac OS X?
Thanks a lot!
Vlad

Developing a Xamarin.Mac app is currently not supported in Visual Studio and requires Xamarin Studio running on a Mac with the latest version of Xcode installed.
Windows Forms and Windows APIs are not supported in Xamarin.Mac so you will need to port your UI to NSWindows, NSViewControllers and NSViews. However, you can share the back end code across platforms such as your data models and business level classes. A typical app can share up to 80% of the code across platform.
I would suggest starting with our Hello, Mac documentation as it gives a needed base required for the rest of the Mac documentation.

Related

Visual Studio 2015, Xamarin and target devices

I just downloaded and installed Xamarin for VS2015, including VS2015 SP2 and a host of other stuff. I created a "hello world!" app and got targets for iOS, Android, Universal Windows, Windows 8.1 and Windows Phone 8.1.
I am new to developing for Android and iOS and know that if I want an iOS solution I'll need to purchase a Mac to do that. I have a couple of Windows Phone apps that I might convert to android and iOS apps, so a Mac seems inevitable.
However, my question is can I use the (now) free Xamarin for VS2015 to create and build C# apps that will run on OS X (not iOS), or do I have to learn Objective-C to do that?
There has been a ton of confusion over the new licensing schemes for Xamarin and Visual Studio so one of my coworkers (Amy Burns) put together this great, interactive guide: Licensing Options.
Just follow through the "options" from the top to the bottom by clicking on the appropriate links in a "choose your own adventure" style.
The short story is this: if you meet the requirements of the license, you can use the Community Edition of Visual Studio or Xamarin Studio to code in Xamarin.iOS (this includes watchOS and tvOS), Xamarin.Android and Xamarin.Mac.
If you don't meet the free license requirements you can purchase Visual Studio standalone or MSDN versions Professional or Enterprise (which includes extra features such as discounts on Test Cloud for Enterprise). Visual Studio Professional and Enterprise both include Xamarin Studio on Mac of the same level for free (see the Visual Studio Comparison Chart).
Any Apple OS (iOS, watchOS, tvOS or OS X) requires a physical Mac with the latest version of Xcode and Xamarin Studio installed. For all Apple OSes (excluding OS X), the Mac can be networked to a Windows machine running Visual Studio and development done from there. Mac OS X development in Xamarin.Mac must be done in Xamarin Studio on a physical Mac. These are Apple's restrictions, not Xamarin or Microsofts.
Yes, it is possible to create and build MAC OS apps with Xamarin and C#. Here you have the official Getting Started guide, where you'll find the requirements, such as:
A Mac computer running Mac OS X Yosemite(10.10) or greater.
Xcode 7 and above
Xamarin.Mac and Xamarin Studio
Correct me if I'm wrong, but Visual Studio is free in Mac OS only for MSDN subscribers. However, Xamarin Studio is free.
Xamarin provides Xamarin.Mac which consists of a set of OS-X API bindings (which in the Unified API version contain many of the same APIs as Xamarin.iOS as 64-bit iOS and OS-X share many of the same Frameworks, in name, function and parameters).
That said, you will need to use Xamarin Studio Community Edition on a Mac to do that C#/F# development as Xamarin.Mac is not supported within the Windows/Visual Studio environment.
From Xamarin's FAQ:
Can I still develop Xamarin.Mac apps?
Yes! All Xamarin Studio developers on Mac now have the ability to create Mac apps with Xamarin.Mac, in addition to iOS (and tvOS and watchOS).
Ref: https://www.xamarin.com/faq#xpq9

Can you develop Linux applications with Xamarin?

Is it possible to develop and build Linux applications with Xamarin with the same code base?
After a few years with Ubuntu, my main OS right now is Windows again. But it's not impossible that I could switch to Mac.
Right now I have a bit of experience with Qt and no experience with Xamarin.
With Qt you can develop on Windows, Linux, and Mac and for Windows, Linux, Mac, iOS, Android, Windows Mobile, ... They are pretty clear about that.
Since Xamarin is free and open source now and I still don't have much experience in Qt, I'm considering trying out Xamarin for cross platform development instead of Qt.
Not being able to release my software for Linux would be a deal breaker for me. Being able to develop on Linux would be nice, but is optional.
But after all my Google research, I could only find information and people asking for support to develop on Linux and not for Linux.
As far as I know, this shouldn't be a problem with Mono alone. But as far as I know Xamarin > Mono and I don't get everything in Mono I could get in Xamarin.
I'm also not sure how well-supported Mono will be in the future. For me it looks like Xamarin is much more important for Microsoft than Mono itself.
I'm not sure if it's even possible, since Xamarin is based on Mono, but is it possible that Microsoft will at some point decide not to support Mono with .NET compatibility in the same way as Xamarin, or even cancel Mono as standalone completely?
So I'm looking for one single framework for all desktop and mobile platforms I can rely on, and I want to know if Xamarin and/or Mono and and/or Xamarin + Mono could be an alternative to Qt before I go deeper into any of those solutions.
Just in case someone else comes accross this q/a: the situation has changed. With Xamarin.Forms 3.0, Gtk# is supported (as preview, at this moment). Therefore, full Linux GUI support is enabled.
So, Xamarin now covers:
Android
iOS
UWP apps
WPF apps
Linux Gtk desktop applications
Mac OS
Watch OS
tv OS
Tizen
The only thing left to wish for: JS/HTML5 Web App target platform, as part of Xamarin :)
No, Xamarin is not available for Linux. This was a conscious decision made by the Xamarin team several years ago:
Miguel de Icaza 2011-08-04 11:52:37 UTC
We face a QA problem here.
The problem with supporting Linux is that we would need to create a
self-contained Mono packaging for all of the bits we ship since most
Linux distributions are slightly off when it comes to Mono.
It also means that if we advertise "Linux" we would need to QA a dozen
different combination due to different Linux distributions and
different editions of each distribution.
Perhaps we would support just a single distribution and a single
version, which is closer to what we have to do on Windows/Mac today.
To clarify, the Xamarin product range is not available on Linux (Xamarin Studio, Xamarin.iOS and Xamarin.Android) but MonoDevelop, the foundation of Xamarin Studio, and Mono, the cross-platform .NET runtime, definitely is.
You can build desktop software using MonoDevelop. The MonoDevelop site has plenty of instructions on getting started:
Install MonoDevelop on Linux
Seems that there is a chance of Xamarin Forms work on linux distros. In this reddit thread Miguel de Icaza says:
Some of our team members actually develop in Linux. The reason why we
never released the Linux tools is because we were charging a lot of
money and people would rightfully expect the software to be fully
supported. We had enough keeping our Mac and Windows users happy, and
adding an unknown number of Linux distributions sounded like a hard
task. Now that we are open sourcing the SDKs and I no longer will feel
bad if something does not work under a particular Linux configuration,
I will be happy to release the Linux builds.
That is: the fact that Forms is an open source tool currently opens this possibility.
Yes, as of mid-2018, it is possible to develop cross platform GUI applications that target windows/mac/linux/android/ios using the "Xamarin.Forms" library. Basically, you have one shared library project from cross platform code (UI and other cross platform stuff), and one project per platform for platform-specific code (Xamarin.Forms have one backend implementation for each platform. On Linux, this is using GTK).
However, with MonoDevelop you can only develop/build the cross-platform project and the linux-specific project of the application. You will still need to use Visual Studio or Rider to develop/build for the other platforms.
See the following answer:
https://stackoverflow.com/a/53317021/298005
https://github.com/0xFireball/xamarin-android-linux
As matthewrdev said, Xamarin.Studio, Xamarin.iOS, and Xamarin.Android aren't "officially" supported; however, Xamarin.iOS uses virtual emulator anyway (and I don't think there will be a workaround for Xamarin.iOS to run on Linux), but for Xamarin Studio (MonoDevelop on Linux, or Jetbrain's Riders (how to run it on linux with no official support is also provided in the link) Can run on Linux as an alt for Xamarin.Studio, and that link I shared explains how to install Xamarin.Android on linux, so just for Xamarin.iOS you will need to migrate or dual boot or sth, I hope that helps! (I stopped using Xamarin my-self, however, this environment helps developing for Xamarin on linux!)
GTK is listed as one of supported platforms/backends for Xamarin.Forms which allows building apps for Linux (as well as macOS and Windows via same GTK project). Though it doesn't look like there was much of development since 2018/2019 and Xamarin.Forms 3.0. Tried running 2 apps with basic UI and compared GTK backedn on Windows/macOS (comparing to WPF and Xamarin.mac back-ends ) and found GTK not worth pursuing (basic scenarios failing).
You can track GTK progress at https://github.com/jsuarezruiz/forms-gtk-progress/blob/master/Status.md
On Ubuntu 20.04, you can run your ASP.Net MVC 5 application using XSP4. Open a console to where you installed your MVC applications, where all folders, Global.asax, Web.config, ... are and run "xsp4 --port 80" or any other port you like and available. XSP4 is an independent web server and does not need Apache to be run.
Also, for C# developers, even the MonoDevelop is not in Ubuntu 20.04, which I don't know why, you can still install it and debug your ASP.Net MVC application. You can also debug any WinForm and console application using the MonoDevelop. YOu can run all your application using mono too.

C# mono GTK how to pack for Mac OS X

I have developed an application on my Windows machine, using Xamarin Studio, targeting Mono / .Net 4.5 and using GTK. The app runs on my Windows machine since I have .Net installed, now I need to deploy to a Mac. The Mac has Mono Runtime already installed, but I have no idea what to send.
If there is anything I need to "pack" or "link" I need to do it on my Windows machine and only send one or more files to the Mac user, so they can run it. After hours of reading, I keep hearing about mkbundle and MonoMac, but it seems that you use them on a Mac or at least I have not found a clear guide on how to do this on my Windows computer.
Here is the question - I have only one .exe right now, how do I "convert" this to a Mac "executable?"

How to develop cross platform mobile application using Visual Studio

May be this is a question when a programmer/developer thinks to start mobile application development. But he is habitual of a particular environment in which he is working from several years. So it would be more comfortable that he can develop mobile app in the same environment what he is using from years.
I am currently working in Asp.Net MVC with C#, Visual Studio 2013 and i like it most. I am working on a large MIS and want to make available my solution to all platforms. As we know mobile devices are the most powerful technology current days.
Please suggest some way that i can work in visual studio and can develop cross platform mobile application that can work on Android, MAC, Windows Mobile and Windows PC/Laptops
I know there is many tools are available, but i need an expert suggestion on this particular scenario. If you provide a solution then please describe how to enable it in visual studio or how to customize current solution for that.
To have .net apps running on mobile platforms other than microsoft, have a look at xamarin
This is the front office for the mono framework
I know it's probably old question but you can try Apache Cordova with Visual Studio.
More options described in here

Is there a way to write iphone and android apps using visual studio and c#?

Is there a way to write iphone and android apps using visual studio and c#? Also if I make a phone app can I easily write it for android, iphone, and windows without havong to write it in 3 different languages?
xamarine is another approach. You can create both Android and iPhone/iPad apps.
MonoTouch
MonoTouch allows developers to create
C# and .NET based applications that
run on Apple's iPhone, iPad, and iPod
Touch devices
MonoDroid
MonoDroid is a development stack for
using C# and core .NET APIs to develop
Android-based applications.
XNATouch
MonoGame is a free implementation of
the XNA Framework for MonoTouch,
MonoDroid and Mac OS X.
Although Visual Studio is really good for Windows and Windows Phone development, it won't help you with Android or iPhone development by itself. And C# being from Microsoft, it's got good support for Windows, and then lesser support through avenues such as Mono. That being said, C# and .NET are open specifications so it is possible to see them on non-Microsoft products such as an Android phone.
That means there are opportunities for using an engine that has been designed as multiplatform. If you're making games, then you can use a platform such as Unity 3D. Unity can be programmed using Visual Studio and scripted using C#. It's also free for personal programming, but the iPhone version does cost money.
Along those same lines, Adobe makes AdobeĀ® Device Central CS5 software. It's programmed with Actionscript, not C#, but I think they are very similar methods of programming. CS5 can be used for both iPhone and Android.
Nokia's QT supports a lot of platforms, including Mac and Windows, Symbian and Linux. There's a port for Android called Necessitas. However, I don't think there's support for iPhone just now.
The main question consideration then is whether you will be happy with your final product. The programming language or engine that you use has a certain influence on how well you achieve your goals.
If you're making a game and know C# already, you might consider Unity although there is a bit of learning involved. I do know that some game studios are using Unity for their games. Check out AirAttack, Startrooper and Batching, as well as the games on this thread: http://forum.unity3d.com/threads/14591-Unity-iPhone-Apps-in-the-Store-List-Yours-Here/page39.
PS: even if you're programming Unity on a Windows computer, at the end of the day to publish on the iPhone you would need to have a Mac and an iPhone SDK installed on it. So technically the answer is yes, you can write iphone apps using visual studio and c#. But to get them into the store and onto an iPhone, you need to perform some steps outside the Visual Studio development environment.
Just to add to the list:
UmbrellaSDK
http://www.umbrellasdk.com
Web development tool for creating portable apps for iPhone as well as Android. You can publish apps to the App Store or Google Play since the apps can be packaged as native on each platform.
DragonFireSDK
http://www.dragonfiresdk.com
Allows iPhone development on Windows (using Visual C++, even Express editions) using C/C++. Apps are fully native and compiled on a Mac server and delivered to your device over the air.
Cheers!
Unfortunately, the short answer is no. But here are some resources that will help you out:
MonoTouch
MonoTouch allows you to build iPhone applications using C#. Unfortunately it is not free, and you need to run it on a Mac.
PhoneGap
PhoneGap lets you build cross-mobile-platform apps using HTML, CSS, and JavaScript. And it's free! No VisualStudio support.
Adobe Flash CS5
With some recent plugins Adobe Flash can now build and publish/package applications for Android and iPhone, as well as desktop applications.

Categories

Resources