diff --git a/aspnetcore/getting-started.md b/aspnetcore/getting-started.md index 0e657d0921..2c96ab8152 100644 --- a/aspnetcore/getting-started.md +++ b/aspnetcore/getting-started.md @@ -13,7 +13,38 @@ uid: getting-started --- # Get started with ASP.NET Core -::: moniker range=">= aspnetcore-2.0" +::: moniker range=">= aspnetcore-2.1" + +1. Install the [!INCLUDE[](~/includes/net-core-sdk-download-link.md)]. + +2. Create a new .NET Core project. + + On macOS and Linux, open a terminal window. On Windows, open a command prompt. Enter the following command: + + ```terminal + dotnet new webapp -o aspnetcoreapp + ``` + +3. Run the app with the following commands: + + ```terminal + cd aspnetcoreapp + dotnet run + ``` + +4. Browse to [http://localhost:5000](http://localhost:5000). + +5. Open *Pages/About.cshtml* and modify the page to display the message "Hello, world! The time on the server is @DateTime.Now": + + [!code-cshtml[](getting-started/sample/getting-started/about.cshtml?highlight=9&range=1-9)] + +6. Browse to [http://localhost:5000/About](http://localhost:5000/About) and verify the changes. + +[!INCLUDE[next steps](~/includes/getting-started/next-steps.md)] + +::: moniker-end + +::: moniker range="= aspnetcore-2.0" 1. Install the [!INCLUDE[](~/includes/net-core-sdk-download-link.md)]. @@ -41,6 +72,7 @@ uid: getting-started 6. Browse to [http://localhost:5000/About](http://localhost:5000/About) and verify the changes. [!INCLUDE[next steps](~/includes/getting-started/next-steps.md)] + ::: moniker-end ::: moniker range="<= aspnetcore-1.1" diff --git a/aspnetcore/mvc/razor-pages/index.md b/aspnetcore/mvc/razor-pages/index.md index a01ad42d63..233bc92113 100644 --- a/aspnetcore/mvc/razor-pages/index.md +++ b/aspnetcore/mvc/razor-pages/index.md @@ -35,18 +35,48 @@ See [Get started with Razor Pages](xref:tutorials/razor-pages/razor-pages-start) # [Visual Studio for Mac](#tab/visual-studio-mac) +::: moniker range=">= aspnetcore-2.1" + +Run `dotnet new webapp` from the command line. + +::: moniker-end + +::: moniker range="= aspnetcore-2.0" + Run `dotnet new razor` from the command line. +::: moniker-end + Open the generated *.csproj* file from Visual Studio for Mac. # [Visual Studio Code](#tab/visual-studio-code) +::: moniker range=">= aspnetcore-2.1" + +Run `dotnet new webapp` from the command line. + +::: moniker-end + +::: moniker range="= aspnetcore-2.0" + Run `dotnet new razor` from the command line. +::: moniker-end + # [.NET Core CLI](#tab/netcore-cli) +::: moniker range=">= aspnetcore-2.1" + +Run `dotnet new webapp` from the command line. + +::: moniker-end + +::: moniker range="= aspnetcore-2.0" + Run `dotnet new razor` from the command line. +::: moniker-end + --- ## Razor Pages diff --git a/aspnetcore/mvc/razor-pages/ui-class.md b/aspnetcore/mvc/razor-pages/ui-class.md index 3ab1597769..99a6c78afd 100644 --- a/aspnetcore/mvc/razor-pages/ui-class.md +++ b/aspnetcore/mvc/razor-pages/ui-class.md @@ -183,7 +183,21 @@ Run the app. Create a Razor Pages web app and a solution file containing the Razor Pages app and the Razor Class Library: -``` CLI +::: moniker range=">= aspnetcore-2.1" + +```console +dotnet new webapp -o WebApp1 +dotnet new sln +dotnet sln add WebApp1 +dotnet sln add RazorUIClassLib +dotnet add WebApp1 reference RazorUIClassLib +``` + +::: moniker-end + +::: moniker range="= aspnetcore-2.0" + +```console dotnet new razor -o WebApp1 dotnet new sln dotnet sln add WebApp1 @@ -191,14 +205,16 @@ dotnet sln add RazorUIClassLib dotnet add WebApp1 reference RazorUIClassLib ``` +::: moniker-end + Build and run the web app: -``` CLI +```console cd WebApp1 dotnet run ``` ------- +--- diff --git a/aspnetcore/security/authentication/accconfirm.md b/aspnetcore/security/authentication/accconfirm.md index fe3601bd8d..6225887fb1 100644 --- a/aspnetcore/security/authentication/accconfirm.md +++ b/aspnetcore/security/authentication/accconfirm.md @@ -31,11 +31,24 @@ See [this PDF file](https://github.com/aspnet/Docs/tree/master/aspnetcore/securi # [ASP.NET Core 2.x](#tab/aspnetcore2x) +::: moniker range=">= aspnetcore-2.1" + +```console +dotnet new webapp --auth Individual -o WebPWrecover +cd WebPWrecover +``` + +::: moniker-end + +::: moniker range="= aspnetcore-2.0" + ```console dotnet new razor --auth Individual -o WebPWrecover cd WebPWrecover ``` +::: moniker-end + * `--auth Individual` specifies the Individual User Accounts project template. * On Windows, add the `-uld` option. It specifies LocalDB should be used instead of SQLite. * Run `new mvc --help` to get help on this command. diff --git a/aspnetcore/security/authentication/individual.md b/aspnetcore/security/authentication/individual.md index a4dd1bcb33..a8f5474a10 100644 --- a/aspnetcore/security/authentication/individual.md +++ b/aspnetcore/security/authentication/individual.md @@ -16,12 +16,26 @@ ASP.NET Core Identity is included in project templates in Visual Studio with the The authentication templates are available in .NET Core CLI with `-au Individual`: +::: moniker range=">= aspnetcore-2.1" + +```console +dotnet new mvc -au Individual +dotnet new webapi -au Individual +dotnet new webapp -au Individual +``` + +::: moniker-end + +::: moniker range="= aspnetcore-2.0" + ```console dotnet new mvc -au Individual dotnet new webapi -au Individual dotnet new razor -au Individual ``` +::: moniker-end + The following articles show how to use the code generated in ASP.NET Core templates that use individual user accounts: * [Two-factor authentication with SMS](xref:security/authentication/2fa) diff --git a/aspnetcore/security/authentication/scaffold-identity.md b/aspnetcore/security/authentication/scaffold-identity.md index af1c2247d3..756586438f 100644 --- a/aspnetcore/security/authentication/scaffold-identity.md +++ b/aspnetcore/security/authentication/scaffold-identity.md @@ -74,7 +74,8 @@ Optional: Add the login partial (`_LoginPartial`) to the layout file: ## Scaffold identity into a Razor project with individual authorization