Skip to content

Instantly share code, notes, and snippets.

@kevincolten
Last active November 20, 2017 19:37
Show Gist options
  • Select an option

  • Save kevincolten/ba19d89e10f195b5631d3c7c5ccdcecc to your computer and use it in GitHub Desktop.

Select an option

Save kevincolten/ba19d89e10f195b5631d3c7c5ccdcecc to your computer and use it in GitHub Desktop.
@post Up and running with C#

Install Guide (Mac OSX)

C#

  1. Install Mono
  • Also available through Homebrew brew install mono
  1. Install Visual Studio Code

ASP.net

  1. Install .NET Core
  1. Install Node.js
  • preferably through nvm
    1. brew install nvm
    2. Add this to either your ~/.bash_profile or ~./zshrc then restart terminal
    export NVM_DIR="$HOME/.nvm"
    
    . "$(brew --prefix nvm)/nvm.sh"
    1. nvm install stable
  1. Install JavaScript dependencies npm install -g yo bower grunt-cli gulp generator-aspnet

Run a C# Script

  1. Create a new file from your terminal code hello.cs
using System;
  				
public class Program
{
    public static void Main()
    {
  	  Console.WriteLine("Hello World");
    }
}
  1. Save the file and open your terminal.
  2. Run mcs hello.cs then mono hello.exe
  3. Verify file ran Hello World!

Resources

Setting up Visual Studio Code on Mac

  1. brew cask install dotnet mono-mdk visual-studio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment