forked from dotnet/AspNetCore.Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-toc
Conflicts: docs/aspnet5/index.rst docs/index.rst
- Loading branch information
Showing
65 changed files
with
1,114 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. :orphan: | ||
.. _Author: | ||
|
||
Author | ||
^^^^^^ | ||
.. container:: author | ||
|
||
.. container:: photo | ||
|
||
.. image:: /_authors/photos/noel-rice.jpg | ||
|
||
.. container:: bio | ||
|
||
Noel Rice is an author of books, blogs, and articles, and a Master Consultant at `Falafel Software`_. You can follow him at http://blog.falafel.com/author/noel-rice. | ||
|
||
.. _`Falafel Software`: http://falafel.com/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Creating a Cross-Platform Console App with DNX | ||
============================================== | ||
By `Steve Smith`_ | Originally Published: 1 June 2015 | ||
|
||
.. _`Steve Smith`: Author_ | ||
|
||
Using the .NET Execution environment (DNX), it's very easy to run a simple console application. | ||
|
||
This article covers the following topics: | ||
- `Creating a Console App`_ | ||
- `Specifying Project Settings`_ | ||
- `Running the App`_ | ||
|
||
You can `view and download the source <https://github.com/aspnet/Docs/tree/master/samples/CreatingConsoleAppWithDNX>`_ from the project created in this article. | ||
|
||
Creating a Console App | ||
---------------------- | ||
|
||
Before you begin, make sure you have successfully installed DNX on your system: | ||
- :doc:`Installing on Windows </getting-started/installation/installing-on-windows/installing-on-windows>` | ||
- :doc:`Installing on Mac OS X </getting-started/installation/installing-on-mac/installing-on-mac>` | ||
|
||
Open a console or terminal window in an empty working folder, where ``dnx`` is configured. | ||
|
||
Creating a console application is extremely straightforward. For this article, we're going to use the following C# class, which has just one line of executable code: | ||
|
||
.. literalinclude:: ../../../../samples/CreatingConsoleAppWithDNX/Program.cs | ||
:linenos: | ||
:language: c# | ||
|
||
It really doesn't get any simpler than this. Create a file with these contents and save it as ``Program.cs`` in your current folder. | ||
|
||
Specifying Project Settings | ||
--------------------------- | ||
|
||
Next, we need to provide the project settings DNX will use. Create a new ``project.json`` file in the same folder, and edit it to match the listing shown here: | ||
|
||
.. literalinclude:: ../../../../samples/CreatingConsoleAppWithDNX/project.json | ||
:linenos: | ||
:language: javascript | ||
|
||
Save your changes. | ||
|
||
Running the App | ||
--------------- | ||
|
||
At this point, we're ready to run the app. You can do this by simply entering ``dnx . run`` from the command prompt. You should see a result like this one: | ||
|
||
.. image:: _static/dnx-run.png | ||
|
||
..note:: ``dnx`` references several `environment variables <https://github.com/aspnet/Home/wiki/Environment-Variables>`_, such as ``DNX_TRACE``, that affect its behavior. | ||
|
||
Set the ``DNX_TRACE`` environment variable to 1, and run the application again. You should see a great deal more output: | ||
|
||
.. image:: _static/dnx-trace-run.png | ||
|
||
In this example, running on the Windows platform, the default behavior for DNX is to run on the full .NET Framework. You can switch to use the CoreCLR by running ``dnvm upgrade -r CoreCLR``. To return to using .NET CLR, run ``dnvm upgrade -r CLR``. | ||
|
||
You can see the app continues to run after switching to use CoreCLR: | ||
|
||
.. image:: _static/dnx-trace-coreclr-run.png | ||
|
||
Summary | ||
------- | ||
|
||
Creating and running your first console application on DNX is very simple, and only requires two files. | ||
|
||
.. include:: /_authors/steve-smith.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.1 KB
docs/js-web-tools/bootstrap/_static/bootstrap-in-starter-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+93.2 KB
docs/js-web-tools/bootstrap/_static/narrow-and-wide-viewport-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.