GithubHelp home page GithubHelp logo

home's Introduction

ASP.NET vNext Home

In the next version of ASP.NET we are working with multiple teams around Microsoft to create a lean, composable .NET stack that provides a familiar and modern framework for web and cloud scenarios.

The Home repository is the starting point for people to learn about ASP.NET vNext, it contains samples and documentation to help folks get started and learn more about what we are doing.

These products are actively developed by the ASP.NET team assigned to the Microsoft Open Tech Hub and in collaboration with a community of open source developers. Together we are dedicated to creating the best possible platform for web development.

The samples provided are designed to show some of the features of the new framework as well as setting up a sandbox for you to try out some of the new features. The NuGet.config file in the repo points to a MyGet feed (https://www.myget.org/F/aspnetvnext/) that has all the packages being developed. The feed is updated every time a full build succeeds.

Minimum Requirements

These are the current minimum requirements, they do not necesarilly represent our RTM minimum.

Windows

  • Windows 7 or greater, though Core CLR will only work on Windows 8 today. If using Core CLR you will need to be on Windows 8 or above. At RTM the whole stack will support Windows 7+ and Windows Server 2008 R2+.
  • .NET 4.5.1 for hosting in IIS

OSX/Linux

  • Mono >= 3.4.1 - Currently this means compiling Mono from source from https://github.com/mono/mono
  • On Linux, you may need to run mozroots --import --sync after installing mono
  • bash or zsh and curl

#Getting Started

The first thing we need to do is setup the tools required to build and run an application. We will start out by getting the K Version Manager (KVM)

The easiest way to get the KVM on Windows is to run the following command:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"

or on OSX/Linux:

curl https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.sh | sh && source ~/.kre/kvm/kvm.sh

This downloads KVM from this repository and puts it on your machine. Alternatively, you you could clone the repo and get it:

  • Clone the repository
  • On the command line execute
  • kvm setup on Windows or
  • sh kvmsetup.sh && source ~/.kre/kvm/kvm.sh on OSX/Linux

This command will setup your environment, getting it ready to install a version of the runtime. It adds KVM to your path and puts it in your user profile. Once you have KVM then you need to get a version of the runtime:

  • Execute kvm install 0.1-alpha-build-0446. This command will download the named version of the KRE and put it on your user profile ready to use. You can get the latest version by running kvm upgrade but 0446 was the last version explicitly tested. see the KVM page for more information on KVM.
  • Navigate to samples\ConsoleApp
  • Run kpm restore. This downloads the System.Console package so the app can do Console.WriteLine
  • Run k run
  • You should see a message saying "Hello World"
  • Type
  • SET KRE_TRACE=1 on Windows or
  • export KRE_TRACE=1 on OSX/Linux
  • Run k run
  • You should now see compiler output as well as the "Hello World" message
:: getting started
git clone https://github.com/aspnet/Home.git
cd Home
kvmsetup
kvm install 0.1-alpha-build-0446 -p

cd samples\ConsoleApp
kpm restore
k run

SET KRE_TRACE=1
k run

Samples

Sandbox Samples

These samples, in this repo, are just basic starting points for you to experiment with features. Since there is no File->New Project we thought some simple samples to take the place of scaffolding would be convenient.

  • ConsoleApp. This is just basic console app if you want to use it as a starting point.
  • HelloWeb. This is a minimal startup class that shows welcome page and static file middleware. This is mostly for you to run through the steps in the readme and make sure you have everything setup and working correctly.
  • HelloMvc. This sample is a basic MVC app. It is not designed to show all the functionality of the new web stack, but to give you a starting point to play with features.

NOTE: The samples are pinned to a specific version of the packages. If you want to try the latest builds then update the project.json and replace the last part of the version with a '*', so '0.1-alpha-build-267' becomes '0.1-alpha-*', and then run kpm restore to pull down the latest packages

Feature Samples

The Entropy repo contains samples of specific features in isolation. Each directory contains just enough code to show an aspect of a feature.

Application Samples

MVC Music Store and BugTracker application are both being ported. Each of these have their own repository that you can look at.

Running the samples

Running HelloWeb

  1. Clone the repository
  2. Change directory to Samples\HelloWeb
  3. Run kpm restore
  4. You should see a bunch of output as all the dependencies of the app are downloaded from MyGet. The K commands all operate on the app that is in the current directory.
  5. Run K web
  6. You should see build output and a message to show the site is now started
  7. Navigate to "http://localhost:5001"
  8. You should see the welcome page
  9. Navigate to "http://localhost:5001/image.jpg"
  10. You should see an image served with the static file middleware

If you can do all of the above then everything should be working. You can try out the WebFx sample now to see some more of the new stack. You should run kpm restore before using any sample for the first time.

Switching to Core CLR

By default when running the applications you are running against Desktop CLR (4.5), you can change that using the KVM command.

  1. Run kvm install 0.1-alpha-build-0446 -svrc50 This command gets the latest Core CLR version of the k runtime and sets it as your default. The -svrc50 switch tells it to use Core CLR, you can use -svr50 to target desktop again.
  2. Run K web
  3. The first line of your output should say "Loaded Module: klr.core45.dll" instead of "Loaded Module: klr.net45.dll"
  4. The HelloWeb app should work the same as when running on Desktop CLR.

NOTE: There are going to be parts of the stack that work on Desktop but do not work on Core CLR. This set should get smaller and smaller as time goes on, but it is entirely likely as you use Core CLR you will hit errors that can't be worked around as the Core CLR surface area just does not exist yet.

NOTE: There is no Core CLR currently on OSX/Linux. There is only a single platform (mono45) and a single architecture (x86).

#Core CLR Packages

Currently the BCL is split into some fairly fine grained packages, which was one of the goals of this effort. However, the packages that exist today do not necessarily represent the list of packages that we will end up with. We are still experimenting with what makes sense to be a package and what the experience should be.

Known Issues

  • Core CLR doesn't currently work on Windows OSes earlier than Windows 8

Feedback

Check out the contributing page to see the best places to log issues and start discussions.

home's People

Contributors

glennc avatar graemechristie avatar eilon avatar davidfowl avatar danroth27 avatar kanchanm avatar janezhouq avatar lodejard avatar loudej avatar haacked avatar rowanmiller avatar chengtian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.