This page has been updated to reflect the changes made from vNext Alpha to Beta
To get started you will need the following software ,frameworks and package managers :
- Download Sublime Text 3
- Install Yeoman
- Install Mono
- Install Homebrew
node --version && npm --versionCheck to see if you have git installed as well .
git --versionYeoman is an open source sleek scaffolding tool that consists frameworks that make it quick and easy to build web applications. The neat thing about Yeoman is it combines several functions into one place, such as template generators which we are going to use to get the ASP.NET vNext up and running .
sudo npm install —global yoNow that Yeoman is installed the next step is to get our ASP.NET framework installed using the yeoman generator.
npm install -g generator-aspnetFor this examples I selected the MVC Application. Once you have entered an appropriate name, the generator will take care of the rest.
Now that MVC application all ready , navigate to the folder notice the model, view and control are all there. Similar to what you find if you used the MVC model template in Visual Studio.
Before you can run your ASP.NET vNext in sublime there are still a couple of dependencies that need to be installed. A lot of tutorials I have read miss the dependencies below but I encountered a lot of errors when trying to configure the K commands.
In order to run an ASP.NET vNext on a Mac and Linux environment you need Mono. Copy and paste the code below into your terminal.git clone https://github.com/mono/mono.gitHomebrew is an open source software package management tool ; it enables you install all the stuff you can't directly install in terminal out of the box. To install Homebrew you will need to copy and paste the Ruby code below.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now, that Homebrew installed make sure to install all the extra mono dependencies.
brew install autoconf brew install automake brew install libtool
Install the ASP.NET vNext Tools
If you had already tapped the repo for previous releases(Alpha) you will be to run the untap command to delete the old commands and tap again to get the updated brew scripts.
Untap Command
brew untap aspnet/k
Tap Command & Install kvm
brew tap aspnet/k brew install kvmIt is important to note that in the current version of Asp.Net vNext Kestrel doesn’t come with it out of the box. So in this case since I am using the "Kestrel": "1.0.0-beta1" (from "Kestrel": "1.0.0-beta1" ). To find out which version of Kestrel you are running, open your project.json file in your Asp.Net project. To install Kestrel copy and paste the code below.
kvm install 1.0.0-beta1Since this is possibly the first ASP.NET project you will need to install the Kulture as instructed in here using the package control plugin. If you have some issues with these steps, you can install it manually using the following steps:
- Open your project in sublime
- Click view
- Click show console and copy and paste the python code below
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
Steps to running your project
- In sublime enter Cmd + Shift + p
- Type K and select run K Command
- Select kpm build
- Select k kestrel - If everything has installed correctly the server should start
- Navigate http://localhost:5004/