Update README.md

This commit is contained in:
danroth27 2014-08-14 22:43:30 -07:00
parent 7551451cb3
commit 79d8de462b
1 changed files with 37 additions and 78 deletions

115
README.md
View File

@ -10,25 +10,30 @@ The samples provided in this repo are designed to show some of the features of t
These are the current minimum requirements for the latest preview release. They do not necessarily represent what the final minimum requirements will be.
### Windows
#### Windows
* Windows 7 or Windows Server 2008 R2.
* .NET 4.5.1 for hosting in IIS
### OS X/Linux
* Mono >= 3.4.1 - Currently this means compiling Mono from source from https://github.com/mono/mono (Note: See instructions below to install the Homebrew formula that can install the required mono)
* On Linux, you may need to run `mozroots --import --sync` after installing mono
#### OS X/Linux
* Mono 3.4.1 or later (Note: On OS X use the Homebrew formula specified below to install the required version of Mono)
* bash or zsh and curl
## Getting Started
The easiest way to get started with ASP.NET vNext is to try out the latest preview of Visual Studio "14". You can find installation instructions and getting started documentation at http://www.asp.net/vnext.
That said, you can also try out ASP.NET vNext with just a command-prompt and a text editor. The following instructions will walk you through getting your dev environment setup.
### Install the K Version Manager (KVM)
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)](https://github.com/aspnet/Home/wiki/version-manager). You use the K Version Manager to install different versions of the ASP.NET vNext runtime and switch between them.
### Windows
#### Windows
To install KVM on Windows run the following command, which will download and run a script that installs KVM for the current user:
```powershell
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"
```
### OS X:
#### OS X:
To install KVM and the correct version of Mono on OS X using [Homebrew](http://brew.sh) follow the following steps:
@ -36,102 +41,56 @@ To install KVM and the correct version of Mono on OS X using [Homebrew](http://b
* Run command `brew tap aspnet/k` to tap the ASP.NET vNext related git repositories.
* Run command `brew install kvm` to install KVM. This also automatically install the latest KRE package from https://www.myget.org/f/aspnetmaster/api/v2 feed.
* Run command `source kvm.sh` on your terminal if your terminal cannot understand kvm.
* To make sure you get the KRE packages from the right myget feed execute `export KRE_FEED=https://www.myget.org/f/aspnetmaster/api/v2`.
### Linux:
#### Linux:
To install KVM on Linux run the following command:
```
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 kvminstall.sh && source ~/.kre/kvm/kvm.sh``` on OSX/Linux
### Install the K Runtime Environment (KRE)
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 1.0.0-alpha3```. 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](https://github.com/aspnet/Home/wiki/version-manager) 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
kvm setup
kvm install 1.0.0-alpha3 -p
cd samples\ConsoleApp
kpm restore
k run
SET KRE_TRACE=1
k run
```
Now that you have KVM setup you can install the latest version of the runtime by running the following command: ```kvm install 1.0.0-alpha3```
This command will download the specified version of the K Runtime Environment (KRE), and put it on your user profile ready to use. You are now ready to start using ASP.NET vNext!
# 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.
The samples in this repo are basic starting points for you to experiment with.
+ [ConsoleApp](https://github.com/aspnet/Home/tree/master/samples/ConsoleApp). This is just basic console app if you want to use it as a starting point.
+ [HelloWeb](https://github.com/aspnet/Home/tree/master/samples/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](https://github.com/aspnet/Home/tree/master/samples/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.
+ [MVC Music Store](https://github.com/aspnet/MusicStore) and [BugTracker](https://github.com/aspnet/BugTracker) are application samples ath are both being ported to ASP.NET vNext. Each of these samples have their own separate repositories that you can look at.
**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](https://github.com/aspnet/Entropy) contains samples of specific features in isolation. Each directory contains just enough code to show an aspect of a feature.
## Running the samples
## Application Samples
[MVC Music Store](https://github.com/aspnet/MusicStore) and [BugTracker](https://github.com/aspnet/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
1. Clone the Home repository
2. Change directory to the folder of the sample you want to run
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``` to run on WebListener. Or run ```K kestrel``` to run on Mono.
6. You should see build output and a message to show the site is now started
7. Navigate to "http://localhost:5001" or "http://localhost:5004" in case of Mono
8. You should see the welcome page
9. Navigate to "http://localhost:5001/image.jpg" or "http://localhost:5004/image.img" in case of Mono.
10. You should see an image served with the static file middleware
4. You should see a bunch of output as all the dependencies of the app are downloaded from MyGet.
5. Run the sample using the appropriate K command:
- For the console app run ```k run```.
- For the web apps run ```k web``` on Windows or ```k kestrel``` on Mono.
6. You should see the output of the console app or a message to show the site is now started.
7. Navigate to the web apps in a browser by going to "http://localhost:5001" or "http://localhost:5004" if running on Mono.
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
# Switching to Core CLR
By default when running ASP.NET vNext applications on the Windows platform you are running on the full .NET Framework. You can switch to use the new Cloud Optimized runtime, or Core CLR, using the KVM command.
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 1.0.0-alpha3 -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``` to run on WebListener. Or run ```K kestrel``` to run on Mono.
1. Run ```kvm install 1.0.0-alpha3 -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``` to run on WebListener.
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.
4. The HelloWeb app should work the same as when running on the full desktop .NET Framework but now as a fully self-contained app with true side-by-side versioning support.
**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 are many APIs from the .NET Framework that are not yet available when running on Core CLR. This set should get smaller and smaller as time goes on.**
**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
**NOTE: There is no Core CLR currently available on OSX/Linux. There is only a single platform (mono45) and a single architecture (x86).**
# Feedback