cross platform code sharing between mac and windows

hello

i have the problem now that i can create a project on mac and share it with my windows machine without any problems. but when i create a project on windows and try to run it on the mac i got some errors saying it cant copy some files because the source file doesnt exitst???

does anyone know a solution for this?

thanks in advance!

There is a thread for this very recently and it would have shown up in the Your Post is Similar To panel when you made the post…

Thanks @MrValentine for linking my thread, but unfortunately I received no responses to it.

@Kay What I figured out when dealing with this myself is exactly what you’ve already figured out. If you want to create a project that works across both Windows and Mac, you have to create the project on Mac first and then share that project between the Mac and Windows machines. The Mac template creates a special kind of “Program.cs” file that helps the project run on Mac, while the Windows template creates a very basic “Program.cs” file that isn’t as friendly to Mac. I’m sure this isn’t the only difference, but it’s the one I mostly noticed.

1 Like

I would help out however, there is no simple way to Emulate a Mac… without hopping through some questionable hoops, and will likely not have a Mac system until 2018 or so… though, you never know what will happen this year…

I think your solution there is the Portable Library method right?

Side note, the reason for the missing files is the File System differences… NTFS C:\... is not possible on a Mac [Well not readily anyway] though you could possibly restructure the file paths to reflect the mac directory structure however I think you already hit the best route…

Though perhaps a better route would be to use the Shared Code route instead… that way you simply copy across the Shared Code/Assets folders between the two and have two dedicated projects instead… makes sense as Windows UI and Mac UI will be different anyway or you can do Conditional compilation though if only targeting two platforms, two individual projects would work best in my opinion…

I hope that helps…

A quick Bing search:

Brought up:

This thread:

And this possibly more useful link:

https://www.codeproject.com/articles/595757/monogame-aplusbuildingplusportableplussolutions

Will add that to the UMGRL thread…

Found this just now:

https://www.codeproject.com/Articles/1129564/MonoGame-Building-Multi-platform-Solutions

In case the YouTube link is not so obvious [Because it isn’t]:

thanks for the reply’s! i’m gonna test these possible solutions and just wait untill monogame support both ways :confused: and else just start with creating the projects on the mac :stuck_out_tongue:

1 Like