2015-04-18 02:23:47 +08:00
Installing ASP.NET 5 On Mac OS X
================================
2015-05-21 13:56:17 +08:00
2015-11-25 09:23:35 +08:00
By `Daniel Roth`_ , `Steve Smith`_ , `Rick Anderson`_
2015-04-18 02:23:47 +08:00
2015-12-04 14:58:10 +08:00
.. contents :: Sections:
2015-11-14 15:45:28 +08:00
:local:
:depth: 1
2015-04-18 02:23:47 +08:00
2015-11-14 15:45:28 +08:00
Install ASP.NET 5 with Visual Studio Code
-----------------------------------------
2015-04-18 02:23:47 +08:00
2015-11-14 15:45:28 +08:00
The easiest way to get started building applications with ASP.NET 5 is to install the latest version of Visual Studio Code.
2015-11-25 09:23:35 +08:00
#. Install `Mono <http://www.mono-project.com/docs/getting-started/install/mac/> `__ for OS X (required by Visual Studio Code).
2015-12-04 14:58:10 +08:00
2015-11-25 09:23:35 +08:00
#. Install `Visual Studio Code <https://go.microsoft.com/fwlink/?LinkID=534106> `__
2015-11-14 15:45:28 +08:00
2015-11-25 09:23:35 +08:00
#. Install `ASP.NET 5 for Mac OS X <https://go.microsoft.com/fwlink/?LinkId=703940> `__
2015-11-14 15:45:28 +08:00
You are all set up and ready to write :doc: `your first ASP.NET 5 application on a Mac </tutorials/your-first-mac-aspnet>` !
Install ASP.NET 5 from the command-line
2015-09-02 12:10:28 +08:00
---------------------------------------
2015-04-18 02:23:47 +08:00
2015-11-14 15:45:28 +08:00
You can also install ASP.NET 5 from the command-line. There are a few steps involved, since we'll need to install and configure the environment in which ASP.NET runs, the :doc: `/dnx/index` . To install DNX, we need one more tool, the .NET Version Manager (DNVM).
Install the .NET Version Manager (DNVM)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2015-11-25 09:23:35 +08:00
To install DNVM:
2015-04-18 02:23:47 +08:00
2015-11-25 09:23:35 +08:00
.. This is only necessary if you don't already have a bash profile and the install script will tell you to do this if you need to.
.. #. Open a Terminal.
.. #. Type ``cd ~/`` to go to your home folder.
.. #. Enter ``touch .bash_profile`` to create a new bash profile.
2015-04-18 02:23:47 +08:00
2015-11-14 15:45:28 +08:00
2015-11-25 09:23:35 +08:00
#. Run the following `` curl `` command::
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh
#. Run `` dnvm list `` to show the DNX versions installed
#. Run `` dnvm `` to get DNVM help
The .NET Version Manager (DNVM) is used to install different versions of the .NET Execution Environment (DNX) on OS X.
2015-04-18 02:23:47 +08:00
2015-09-02 12:10:28 +08:00
Install the .NET Execution Environment (DNX)
2015-11-14 15:45:28 +08:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2015-04-18 02:23:47 +08:00
2015-09-19 05:21:11 +08:00
The .NET Execution Environment (DNX) is used to build and run .NET projects. Use DNVM to install DNX for `Mono <http://mono-project.com> `_ or .NET Core (see :doc: `choosing-the-right-dotnet` ).
2015-04-18 02:23:47 +08:00
2015-09-19 05:21:11 +08:00
**To install DNX for .NET Core:**
2015-11-14 15:45:28 +08:00
1. Use DNVM to install DNX for .NET Core::
2015-04-18 02:23:47 +08:00
2015-09-02 12:10:28 +08:00
dnvm upgrade -r coreclr
2015-04-18 02:23:47 +08:00
2015-09-19 05:21:11 +08:00
**To install DNX for Mono:**
2015-07-18 03:06:38 +08:00
2015-09-19 05:21:11 +08:00
1. Install `Mono <http://www.mono-project.com/docs/getting-started/install/mac/> `__ for OS X. Alternatively you can install Mono via `Homebrew <http://brew.sh/> `__ .
2015-04-21 05:18:54 +08:00
2015-09-19 05:21:11 +08:00
2. Use DNVM to install DNX for Mono::
2015-04-18 02:23:47 +08:00
2015-09-19 05:21:11 +08:00
dnvm upgrade -r mono
2015-09-02 12:10:28 +08:00
2015-09-19 05:21:11 +08:00
By default DNVM will install DNX for Mono if no runtime is specified.
2015-04-21 05:18:54 +08:00
2015-11-25 09:23:35 +08:00
.. note :: Restoring packages using DNX on Mono may fail with multiple canceled requests. You may be able to work around this issue by setting `` MONO_THREADS_PER_CPU `` to a larger number (2000).
2015-04-18 02:23:47 +08:00
Related Resources
2015-04-28 14:03:00 +08:00
-----------------
2015-04-18 02:23:47 +08:00
2015-09-02 12:10:28 +08:00
- :doc: `/tutorials/your-first-mac-aspnet`
2015-09-19 05:21:11 +08:00
- :doc: `/fundamentals/index`