How to run a Windows Forms application on macOS? [

2020-07-01 02:24发布

Is it possible to run a Windows Forms application (developed using Visual Studio on Windows) on macOS?

What would be needed? Is it free or would I have to purchase something?

标签: c# winforms mono
6条回答
Lonely孤独者°
2楼-- · 2020-07-01 02:52

The .Net Core is cross platform though it doesn't include winform (maybe it will in the future) or Wpf (definitely won't be cross platform in future).

You can use Xamarin Studio and Mono to make a winform app for mac, though if you want to to use Visual Studio buy Xamarin business license for VS support or make a XNA or a web app. See my answer here .net core for linux and mac for more info.

查看更多
姐就是有狂的资本
3楼-- · 2020-07-01 02:53

Wine is capable of running some winforms-based Windows applications on Mac OSX. When it works as intended, all you have to do is install Wine on the Mac, and then it can run your exe. Of course this won't always work perfectly, and it won't have the polish of a native Mac app, but for simpler Winforms apps it should work.

查看更多
兄弟一词,经得起流年.
4楼-- · 2020-07-01 02:54

Yes, it is possible. For example, you can use Mono.

查看更多
劳资没心,怎么记你
5楼-- · 2020-07-01 02:58

You might be able to cross-compile using Mono. http://www.mono-project.com/docs/gui/winforms/

查看更多
Summer. ? 凉城
6楼-- · 2020-07-01 03:01

This is not possible. C# winform applications can only run on Windows.

查看更多
冷血范
7楼-- · 2020-07-01 03:03

I've used Xamarin and GTK#, as well as Xamarin for code-behind and XCode for forms design. They both work pretty decently with C# for code-behind stuff.

Just keep in mind that GTK# looks quite clunky and dated when you put it next to a native Mac application.

On the other hand, the object framework for XCode forms (yeah, I know I'm not using the "correct" terminology...) presents a bit of a learning curve, but isn't terribly hard, and Xamarin did a sweet job of integrating the object model into C#, so between the Apple documentation and what Xamarin provides, and er.. from StackOverflow itself, you should be able to produce some neat-looking apps.

查看更多
登录 后发表回答