Merge branch '1.0.0-beta7' into 1.0.0-beta8

pull/403/head^2
danroth27 2015-09-21 09:13:52 -07:00
commit d1e8ff6db8
6 changed files with 32 additions and 33 deletions

View File

@ -18,17 +18,17 @@ The Yeoman command line tool **yo** works alongside a Yeoman generator. Generato
- You can even `generate your own Yeoman generator <https://github.com/yeoman/generator-generator>`_.
In this article:
- `Getting Started`_
- `Building and Running from Visual Studio`_
- `Client-Side Build Support`_
- `Restoring, Building and Hosting from the Command Line`_
- `Adding to Your Project with Sub Generators`_
- `Getting Started`_
- `Building and Running from Visual Studio`_
- `Client-Side Build Support`_
- `Restoring, Building and Hosting from the Command Line`_
- `Adding to Your Project with Sub Generators`_
Getting Started
---------------
The `ASPNET generator <https://www.npmjs.com/package/generator-aspnet>`_ creates ASP.NET 5, DNX projects that can
be loaded into Visual Studio 2015 or run from the command line. The generator creates the following project types:
- Empty Application: An empty Web application with minimal dependencies.
- Console Application: A DNX-based console application.
- Web Application: A complete MVC web application with a simple home page and examples for managing accounts and login.
@ -38,9 +38,9 @@ be loaded into Visual Studio 2015 or run from the command line. The generator cr
This walk-through demonstrates how to use Yeoman to generate an ASP.NET 5 web application.
1. Follow the instructions on http://yeoman.io/learning/ to install **yo** and other required tools.
1. Follow the instructions on http://yeoman.io/learning/ to install **yo** and other required tools.
2. On the command line, install the ASP.NET generator:
2. On the command line, install the ASP.NET generator:
.. code-block:: console
@ -48,29 +48,29 @@ This walk-through demonstrates how to use Yeoman to generate an ASP.NET 5 web ap
.. note:: The **g** flag installs the generator globally so that you can use it from any path on your system.
3. Make a new directory where your project will be generated:
3. Make a new directory where your project will be generated:
.. code-block:: console
mkdir c:\MyYo
4. On the command line, make the new directory the current directory.
4. On the command line, make the new directory the current directory.
.. code-block:: console
cd c:\MyYo
5. Run the ``yo`` command and pass the name of the generator.
5. Run the ``yo`` command and pass the name of the generator.
.. code-block:: console
yo aspnet
6. The aspnet generator displays a menu. Select the **Web Application** and press ``Enter``.
6. The aspnet generator displays a menu. Select the **Web Application** and press ``Enter``.
.. image:: yeoman/_static/yeoman-yo-aspnet.png
7. Provide an application name "MyWebApp" and press ``Enter``.
7. Provide an application name "MyWebApp" and press ``Enter``.
.. image:: yeoman/_static/yeoman-yo-aspnet-appname.png
@ -138,25 +138,24 @@ You can prepare and host your web application using commands **dnu** (Microsoft
.. code-block:: console
dnx . web
dnx web
The web server will listen on port 5000. The URL and port are defined in project.json in the **commands** section.
The web server will listen on port 5000. The URL and port are defined in the hosting.ini file, which is referenced by the **commands** section of the project.json file.
.. code-block:: json
:emphasize-lines: 2
.. code-block:: c#
:linenos:
:emphasize-lines: 3
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5001",
"gen": "Microsoft.Framework.CodeGeneration",
"ef": "EntityFramework.Commands"
},
"commands": {
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --config hosting.ini",
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --config hosting.ini"
},
5. Open a web browser and navigate to http://localhost:5000.
.. image:: yeoman/_static/yeoman-home-page_5000.png
.. note:: You can also run the cross-platform Kestrel development server using the **dnx . kestrel** command. By default, Kestrel listens on port 5001 as defined in the **project.json**, **commands** section.
.. note:: You can also run the cross-platform Kestrel development server using the **dnx kestrel** command.
Adding to Your Project with Sub Generators
------------------------------------------

View File

@ -84,7 +84,7 @@ A command is a named execution of a .NET entry point with specific arguments. Yo
You can then use DNX to execute the commands defined by your project, like this::
dnx . web
dnx web
Commands can be built and distributed as NuGet packages. You can then use DNU to install commands globally on a machine::

View File

@ -81,7 +81,7 @@ With this in place, all that's required to run an ASP.NET application using this
:language: javascript
:lines: 1-15
When run, this command (equivalent to running ``dnx . web`` from a command line) will search for a package called "NowinSample" that contains an implementation of ``IServerFactory``. If it finds one, it will initialize and start the server as detailed above. Learn more about the built-in ASP.NET :doc:`/fundamentals/servers`.
When run, this command (equivalent to running ``dnx web`` from a command line) will search for a package called "NowinSample" that contains an implementation of ``IServerFactory``. If it finds one, it will initialize and start the server as detailed above. Learn more about the built-in ASP.NET :doc:`/fundamentals/servers`.
Run ASP.NET 5 on an OWIN-based server and use its WebSockets support
--------------------------------------------------------------------

View File

@ -7,7 +7,7 @@ namespace ServersDemo
{
/// <summary>
/// This demonstrates how the application can be launched in a console application.
/// "dnx . run" command in the application folder will invoke this.
/// Executing the "dnx run" command in the application folder will run this app.
/// </summary>
public class Program
{

View File

@ -177,8 +177,8 @@ Open a command prompt in the project directory (ContosoBooks/src/ContosoBooks) a
.. code-block:: none
dnvm use 1.0.0-beta5
dnx . ef migration add Initial
dnx . ef migration apply
dnx ef migration add Initial
dnx ef migration apply
The "``add Initial``" command adds code to the project that allows EF to update the database schema. The "``apply``" command creates the actual database. After you run the run these commands, your project has a new folder named *Migrations*:
@ -190,7 +190,7 @@ The "``add Initial``" command adds code to the project that allows EF to update
Adding C:\\Users\\<user>\\.dnx\\runtimes\\dnx-clr-win-x86.1.0.0-beta5\\bin to process PATH
- **dnx . ef migration add Initial** : `DNX <http://docs.asp.net/en/latest/dnx/overview.html>`_ is the .NET Execution Environment. The ``ef migration apply`` command runs pending migration code. For more information about ``dnvm``, ``dnu``, and ``dnx``, see :ref:`DNX Overview <aspnet:dnx-overview>`.
- **dnx ef migration add Initial** : `DNX <http://docs.asp.net/en/latest/dnx/overview.html>`_ is the .NET Execution Environment. The ``ef migration apply`` command runs pending migration code. For more information about ``dnvm``, ``dnu``, and ``dnx``, see :ref:`DNX Overview <aspnet:dnx-overview>`.
Add an index page
-----------------

View File

@ -55,7 +55,7 @@ Download the ASP.NET 5 starter project
.. code-block:: none
dnvm use 1.0.0-beta5
dnx . ef migration apply
dnx ef migration apply
- **dnvm** : The .NET Version Manager, a set of command line utilities that are used to update and configure .NET Runtime. The command ``dnvm use 1.0.0-beta5`` instructs the .NET Version Manager to add the 1.0.0-beta5 version of the ASP.NET 5 runtime to the ``PATH`` environment variable for the current shell. For ASP.NET 5 Beta 5, the following is displayed:
@ -64,7 +64,7 @@ Download the ASP.NET 5 starter project
Adding C:\\Users\\<user>\\.dnx\\runtimes\\dnx-clr-win-x86.1.0.0-beta5\\bin to process PATH
- `DNX <http://docs.asp.net/en/latest/dnx/overview.html>`_ is the .NET Execution Environment.
- **dnx . ef migration add Initial** : `DNX <http://docs.asp.net/en/latest/dnx/overview.html>`_ is the .NET Execution Environment. The ``ef migration apply`` command runs pending migration code.
- **dnx ef migration add Initial** : `DNX <http://docs.asp.net/en/latest/dnx/overview.html>`_ is the .NET Execution Environment. The ``ef migration apply`` command runs pending migration code.
Run the app
^^^^^^^^^^^^^^^^^^^^^