-2

I made a game in visual studio with C# and .NET, and want to send it to my friend to play as he tries to make a soundtrack for it. He uses a Mac and only Mac. I'm very new to coding, only building projects to submit for school assignments, so I have no idea where to start.

I tried to publish the program for macOSx64 as a self-contained application, My friend said that it didn't work. I haven't published anything before but followed a guide from Mircosoft on how to do so. It might have been something he did wrong on his end, He said that he dropped all the files into the application folder "Like you usually do" but I'm not familiar with macOS so I don't know if this is right or wrong.

Also, I dropped the files on GitHub for him to download as I didn't know a better way for him to download the files. Since the files were so large, I had to make 2 repositories for it.

https://github.com/ShawZachary/EndersDungeonMacOS https://github.com/ShawZachary/EndersDungeonMacOSpart2

xg1ngy
  • 1
  • 3
  • You could try to run it on his mac using Mono. He would have to install that, then run it as `mono yourapp.exe`. No guarantees it will work, but it's a start. More info here: https://www.mono-project.com/ – Andy Aug 04 '20 at 21:51
  • We'd need to know a lot more about your game. Is it an ASP.NET web game? Unity? UWP? – Dour High Arch Aug 04 '20 at 21:51
  • Did you use .NET Core or .NET Framework ? You can use .NET Core for cross-platform applications. [.NET Core vs .NET Framework](https://stackoverflow.com/questions/38063837/whats-the-difference-between-net-core-net-framework-and-xamarin) – dimitar.d Aug 04 '20 at 21:53
  • It is not in unity, it is strictly made in visual studios. in fact, I may have just answered my own question when going back to see exactly which option I chose when making the game. I made it with Console App (.NET core) so I have mistakingly used the wrong tag, but it does say that it can run on Windows, Linux, or macOS. – xg1ngy Aug 04 '20 at 21:55
  • All the APIs we have mentioned can be used in Visual Studio. Tag your question with the actual API you are using, not with the app you wrote it in. Posting some code would also be helpful. – Dour High Arch Aug 05 '20 at 00:07
  • This is a duplicate https://stackoverflow.com/questions/31864724/can-you-install-and-run-apps-built-on-the-net-framework-on-a-mac#:~:text=As%20the%20.,to%20run%20on%20Mac%20OS. – Jeremy Thompson Aug 05 '20 at 00:12
  • [Wine](https://www.winehq.org/) may or may not help.. – TaW Aug 05 '20 at 07:14

2 Answers2

0

Visual Studio is just the development environment that you have used. You can write apps for different .net framework targets irrespective. If you have written it using .net core then you have 2 options. Either have the .net core framework installer as a prerequisite with your game, which will let your users install the .net core framework on their PCs/Macs or compile it as self-contained, which packages the .net core framework with your app so that it can run on most any OS without having to install the .net core framework. The latter makes your game quite a bit bigger in size. Check this out for more info.

  • Thank you for explaining! I tried the latter, as self-contained and he said it didn't work but that may just be on his end. He doesn't code at all and isn't very tech-savvy? From what he told me, it sounded like dropped all the files into the application folder. I'm not familiar with mac so I don't know. I may just take the east route someone mentioned earlier with wine. – xg1ngy Aug 05 '20 at 13:48
  • You are probably missing the RID (runtime id) portion when publishing the app as self contained for macOS. Check this link to find out how:https://learn.microsoft.com/en-us/dotnet/core/deploying/ – Michael vd Berg Aug 06 '20 at 08:50
0

You can use Xamarin Forms to write cross platform applications in C# .Net.

See https://learn.microsoft.com/en-us/xamarin/xamarin-forms/

There is a quite important learning curve though if you are new to programming. But it's so much fun :)

halfer
  • 19,824
  • 17
  • 99
  • 186
TaiT's
  • 3,138
  • 3
  • 15
  • 26