How to compile windows binary on OSX - c#

I did a C# project on my Mac using Xamarin Studio. I need the binary to run on Windows. Right now it's using a gcc compiler. How do I get a Windows binary out of this? (Pretty sure I need to use mingw)

Xamarin Studio builds the exe/dll for you automatically.
In your projects directory E.G. /Users/ashleymedway/Projects/TEST/TEST.
Browse to Build/Debug or Build/Release depending on your configuration profile.
You will see the complied app/library. E.G Test.exe
The executable found here for a test console app ran fine in Windows 8 for me.

Because Windows Phone apps can only be developed on Windows, it is
impossible to develop for all three platforms on the same operating
system
http://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/part_1_-_understanding_the_xamarin_mobile_platform/

Related

How to run Mono application on Windows properly?

I am completely new to Mono and Gtk#. I'm developing an app on Linux but I want to run it on Windows as well. However, if I build the app using MonoDevelop and then run the .exe file in Windows, it doesn't launch.
Is it really possible to make Windows apps using Linux/Mono, or am I missing something?
Baltasarq is correct. The reason that your app won't run is that the dependent GTK# binaries are not on your target machine. The compiled .exe will run on any .NET implementation so long as it is of at least the .NET version that your executable targets and the dependent assemblies are available.
Like Symon said, you have to build your project on the operating system you're intending it to be be compiled for because of the resources (API's etc.) that specific operating system is loaded with.
When I have a problem like this, I simply use a virtual machine software like VirtualBox or VMware to run Windows and then install and run MonoDevelop inside of Windows. Don't worry about the expensive cost of Windows, for you can just get Windows from Microsoft's website here. There will be a little watermark in the corner of the screen because you didn't pay for the copy, but everything is still totally legal and fit for software development.
UPDATE:
A better method to do this is to install the GTK# dependencies and then recompile the program.

How do I compile a C# application on a Mac in Visual Studio?

Basically, my school only has Mac computers, however they're telling me to learn C# and to do so using Visual Studio. However, the school program is fairly new and the projects are self-guided. I've been coding in C# using Visual Studio and it's been working so far - it's run successfully and everything. However, I can't seem to find a way to export or publish my code into a standalone application. I've tried using WineBottler to convert the .exe into a .dmg, but I can't seem to make it work.
How should I do this? Moving to Windows or another IDE/compiler isn't an option. I've currently been creating my projects in a Console App, but I could change that if necessary.
After quite a bit of experimentation and research, I've found that while you can publish a .NET Core Console App within Visual Studio for Mac, the feature is not supported within the GUI of the program (for whatever reason).
In order to publish, you have to Control-Click on the solution in the Solution Explorer and open the project in the command line by clicking Tools > Open In Terminal.
Once there, type in the command:
dotnet publish -c Release --framework netcoreapp2.1 --runtime osx-x64
This will create a self-contained program for 64-bit mac os on the v2.1 .NET Core framework. The runtime can be changed for different operating systems and the version number for netcoreapp can be changed based on which version you're using and what is compatible with any plugins for your program.
The final product will be found in yourprojectfolder/yourprojectname/bin/Release/netcoreapp2.1/osx-x64/publish
You should have no issues creating and compiling .NET CORE console apps using a Mac. These apps will have limited .NET functionality, do not have .exe files, and are platform agnostic. Here is a quick guide you can reference to decide if .NET CORE is the right option for you.
If you are trying to create WinForm apps or something similar, you cannot do this on a Mac. There are "work arounds" using Wine or other tools, but my experience with those options has been suboptimal at best. If you need to create apps like this, then your best option is to program on a Windows machine. Perhaps ask your school to enable bootcamp and install Windows 10 OS on one of the Mac machines.
You can generate exe using the terminal if you are on OSX. You can follow this post
It requires :
Visual Studio For Mac
A .cs file
Few lines in terminal

MonoGame porting to linux

I have developed a game on Windows 7 (64bit) in Visual Studio 2015 with the language C# and the MonoGame framework. The game works fine on Windows, but I also wanted to make the game to be playable on Linux. Therefore I installed VirtualBox with Ubuntu 15.10 (64bit) on my Windows PC, to test if I can make my game running on Ubuntu.
After trying to compile the game in different ways with no solution in sight, I came to the conclusion to ask a few questions here about deploying MonoGame to Linux:
Is it possible to compile a MonoGame game in VisualStudio 2015 on Windows for Linux in a...
1.1. MonoGame Linux Project?
1.2. MonoGame Windows OpenGL Project?
1.3. MonoGame Windows Project? (which my game currently is)
If [1.] what are the requirements and what programs need to be installed on Linux to run this [1.x] build?
Is it possible (and recommended) to compile the game in MonoDevelop on a virtual Ubuntu machine?
Is it even possible to run a MonoGame game on a virtual Ubuntu machine?
What is the proper executable file extension for a game on Linux? (Because Linux Project on Windows is only building a .exe)
I have almost no experience with Linux, so I hope someone can answer me these questions, maybe someone who has experience with porting a MonoGame game to linux.
Thanks.
Though the question is a few years old, it's deserving of an answer. I managed to make cross-platform builds for a game built in MonoGame through Mono's mkbundle. Here is a great tutorial for doing so on Windows.
You'll want to download the latest Mono version and append an "exe" extension to the file located at C:\Program Files (x86)\mono\bin\mono. Next download the appropriate runtime for the platform you want to deploy to, give it a "zip" extension, and extract it into the following path: C:\Users\youruserhere\Documents.mono\targets
After that, you should be ready to build; open up a Command Prompt and enter mkbundle --local-targets. If everything went smoothly, the runtimes you have installed should be displayed. After that is a matter of building an exe to the target platform.
Here's an example for building an application to Ubuntu: mkbundle HelloWorldConsole.exe --simple -o HelloWorldBundleUbuntu --cross mono-5.10.0-ubuntu-16.04-x64
Keep in mind that some classes not implemented in Mono, such as WebBrowser, will cause the build to fail. If this is the case, you may need to find a workaround.
With this you can run the file in Linux by entering ./HelloWorldBundleUbuntu in a Terminal. I've had no issues running the game this way in a virtual machine.
Lastly, if you want to go the .NET Core route, MonoGame has a WIP core fork that you can use, though I'm unsure how well it works.
To add to an already year old answer by Kimimaru, there's also the possibility to use MonoKickstart to get your Monogame executables up and running on Mac and Linux without the need to bundle anything. This is especially handy if your projects are a little difficult to bundle, because of third-party libraries or otherwise.
You simply unpack the Kickstart archive and paste your Windows executable ontop. By editing the .kick files to point to the appropriate executable, they will act as an intermediary to run your programs using mono (which is provided, as well, no need to install on target machine).
https://github.com/mrhelmut/MonoKickstart

xamarin installation and emulator

I have installed xamarin studio in my computer properly. I have checked all installation according to the Xamarin Installer which usually downloads before. I am using window 7.4GB RAM. intel Core I3 processor.
When I select File ==> New ==> Solution and select so c#, F#, and VB.net content is showing.
I am able to select only C# => Android black, ice cream sendwitch .....files only.
How do I create a program for iphone or window phone?
Also if I run code the emulator does not work. The emulator appears but after that no button, label or textbox displays. How do I resolve this?
Read all of this first. http://developer.xamarin.com/guides/cross-platform/getting_started/. Including abilities of IDE on each platform.
Setup Xamarin.iOS on Windows.
http://developer.xamarin.com/guides/ios/getting_started/installation/windows/
I believe that Xamarin Studio does not have iOS support on Windows. To do that you have to use MS Visual Studio, and even then you need Mac to build. In essence, you can't develop for iOS unless you have access to Mac.

How to develop iOS app using Xamarin Studio on Windows?

I'm evaluating a Xamarin Studio indie license which does not include VS integration - Correct me if I am wrong. But I want to know if it's possible to use Xamarin Studio to do iOS development? I'm very interested in the new feature of iOS designer announced at Xamarin Evolve, ideally it shall be possible too on Windows.
If the answer is yes, how?
Currently it is not possible to develop for iOS using Xamarin Studio on Windows.
If you want to use Windows, you can use Visual Studio.
If you want to use Xamarin Studio, you can do so on a Mac.
Note that you will always need a Mac around, even if you're using Visual Studio.
While not specifically answering the question, it should be noted that it is possible to develop for iOS in Visual Studios using a connected Mac as a build host. This connected Mac could either be through the network or can even be a VM running from your Windows machine.
We can use xamarin studio in Mac OS only. If you want to use xamarin in windows you need to download xamarin plug in to visual studio from xamarin.com. Also you must need Mac Os as virtually running on windows for debugging and seeing output. User interface design should only performs on Mac OS Xcode SDK. So only we need Mac OS virtual machine on windows. In visual Studio IOS project file having .xib file (i.e) Xcode Interface builder, in that file only we need to design user interface configurations using xcode on Mac OS.
Using Mac build Host you can do but you'll need the networked mac for developing and debugging too.
or else you can use Xamarin Live Player using which you can debug,develop and deploy the app completely in windows without the help of any Apple system but to sign and release the app to appstore you will need Apple System though
You can code your whole iOS application of from Visual Studio in windows.
When it comes to execution of application, you have to have MAC machine. You can connect your MAC to windows on Network by Mac build Host in order to run, debug your application in windows.
For more information follow this link.
Currently it is not possible to run Apple iOS emulator on windows.
See the official documentation given on url Installing Xamarin.iOS on Windows in Xamarin Developer Documentation which says :-
There are some tasks that Xamarion.iOS for Visual Studio currently cannot do i.e
No iOS simulator on Windows – The iOS Simulator runs on Mac OS X, so
it’s necessary to switch to the Mac’s screen when testing on the
simulator
http://docs.xamarin.com/guides/ios/getting_started/introduction_to_xamarin_ios_for_visual_studio/ says
Xamarin iOS for Visual Studio allows iOS applications to be written and tested on Windows computers, with a networked Mac providing the build and deployment service.
So I think you can do developing and testing (debugging?) but not building nor deploying. CMIIW.

Categories