Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a MacOS Console App using VS on Windows

.NET Core 3.1 Visual Studio 2019

I have created an iOS Xamarin mobile app, using Visual Studio running on Windows. All works fine, even debugging on an iPhone connected to the Mac on my network.

I now need a very simple Console App for the actual Mac (macOS computer). I have already written the Windows version of the Console App.

I cannot work out how to compile the Console App for macOS. Is it possible? Any help appreciated.

like image 792
Rob L Avatar asked Nov 25 '25 22:11

Rob L


1 Answers

If it is not using Xamarin.Mac APIs, then you can "just" use the console app assembl(ies) and run it via dotnet

Or publish it via dotnet as a self-contained executable

dotnet publish --runtime osx.10.11-x64

Or a runtime-dependent cross-platform binary

dotnet publish 

re: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish

But if your app is using Xamarin.Mac APIs, then review my SO answer here:

re: Compile OSX app on Windows with Xamarin

like image 198
SushiHangover Avatar answered Nov 28 '25 16:11

SushiHangover



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!