Reputation: 1671
Sheepishly looking for a short step-by-step guide on taking a single .cs file like:
using System
namespace Simple
{
class Program // declare a class
{
static void Main()
{
Console.WriteLine ("Hi there!");
}
}
}
and be able to compile and run it in Xamarin Studio (version 5.5.1, build 15) on the Mac (Mono SDK is already installed). I am not interested (yet!) in anything complex like developing an app or anything, but just a way to practice learning C#. I do know how to compile and run using Terminal, but can't seem to figure out how to compile/run a simple .cs file from XS. Thanks :) Hopefully my participation here at SO will be a bit more sophisticated in the future :)
Upvotes: 2
Views: 2051
Reputation: 4663
I'm assuming you have created a solution and project in Xamarin Studio? There is a run button in the interface (looks like play on a remote). If you created your .cs file outside Xamarin, you'll probably have to import it into the solution by right clicking the project and clicking add files. I'm pretty sure you can also open a .cs in Xamarin without it having any solution/project attachments. Again, you should be able to hit the play button.
If you haven't got yourself a solution, fire up Xamarin to the welcome page and click new solution. You should have the option to choose C# console project (or even an empty project if you want to start from scratch) or something similar (I'm fuzzy on the details: I typically use MonoDevelop and my copy of Xamarin is buggy right now). Fill out the forms and voilà! A "hello world!" file should be there.
Hope this helps!
Upvotes: 2