Skip to content

Commit

Permalink
Update All package ref content (#9203)
Browse files Browse the repository at this point in the history
Fixes #5314
  • Loading branch information
guardrex authored and Rick-Anderson committed Oct 24, 2018
1 parent 36d5f81 commit 995514f
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 21 deletions.
2 changes: 1 addition & 1 deletion aspnetcore/data/ef-mvc/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Press CTRL+F5 to run the project or choose **Debug > Start Without Debugging** f

## Entity Framework Core NuGet packages

To add EF Core support to a project, install the database provider that you want to target. This tutorial uses SQL Server, and the provider package is [Microsoft.EntityFrameworkCore.SqlServer](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/). This package is included in the [Microsoft.AspNetCore.All](xref:fundamentals/metapackage) metapackage, so you don't have to install it.
To add EF Core support to a project, install the database provider that you want to target. This tutorial uses SQL Server, and the provider package is [Microsoft.EntityFrameworkCore.SqlServer](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/). This package is included in the [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app), so you don't need to reference the package if your app has a package reference for the `Microsoft.AspNetCore.App` package.

This package and its dependencies (`Microsoft.EntityFrameworkCore` and `Microsoft.EntityFrameworkCore.Relational`) provide runtime support for EF. You'll add a tooling package later, in the [Migrations](migrations.md) tutorial.

Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/data/ef-mvc/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ info: Microsoft.EntityFrameworkCore.Database.Command[200101]
Done.
```

Use **SQL Server Object Explorer** to inspect the database as you did in the first tutorial. You'll notice the addition of an __EFMigrationsHistory table that keeps track of which migrations have been applied to the database. View the data in that table and you'll see one row for the first migration. (The last log in the preceding CLI output example shows the INSERT statement that creates this row.)
Use **SQL Server Object Explorer** to inspect the database as you did in the first tutorial. You'll notice the addition of an \_\_EFMigrationsHistory table that keeps track of which migrations have been applied to the database. View the data in that table and you'll see one row for the first migration. (The last log in the preceding CLI output example shows the INSERT statement that creates this row.)

Run the application to verify that everything still works the same as before.

Expand All @@ -150,7 +150,7 @@ Run the application to verify that everything still works the same as before.

The EF tooling for managing migrations is available from .NET Core CLI commands or from PowerShell cmdlets in the Visual Studio **Package Manager Console** (PMC) window. This tutorial shows how to use the CLI, but you can use the PMC if you prefer.

The EF commands for the PMC commands are in the [Microsoft.EntityFrameworkCore.Tools](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools) package. This package is already included in the [Microsoft.AspNetCore.All metapackage](xref:fundamentals/metapackage), so you don't have to install it.
The EF commands for the PMC commands are in the [Microsoft.EntityFrameworkCore.Tools](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools) package. This package is included in the [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app), so you don't need to add a package reference if your app has a package reference for `Microsoft.AspNetCore.App`.

**Important:** This isn't the same package as the one you install for the CLI by editing the *.csproj* file. The name of this one ends in `Tools`, unlike the CLI package name which ends in `Tools.DotNet`.

Expand Down
8 changes: 7 additions & 1 deletion aspnetcore/fundamentals/static-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ Static files are accessible via a path relative to the web root. For example, th

The URI format to access a file in the *images* subfolder is *http://\<server_address>/images/\<image_file_name>*. For example, *http://localhost:9189/images/banner3.svg*.

::: moniker range=">= aspnetcore-2.0"
::: moniker range=">= aspnetcore-2.1"

If targeting .NET Framework, add the [Microsoft.AspNetCore.StaticFiles](https://www.nuget.org/packages/Microsoft.AspNetCore.StaticFiles/) package to your project. If targeting .NET Core, the [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app) includes this package.

::: moniker-end

::: moniker range="= aspnetcore-2.0"

If targeting .NET Framework, add the [Microsoft.AspNetCore.StaticFiles](https://www.nuget.org/packages/Microsoft.AspNetCore.StaticFiles/) package to your project. If targeting .NET Core, the [Microsoft.AspNetCore.All metapackage](xref:fundamentals/metapackage) includes this package.

Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/host-and-deploy/azure-apps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ Discover Azure App Service runtime execution limitations enforced by the Azure A

## Application configuration

In ASP.NET Core 2.0 or later, the following NuGet packages provide automatic logging features for apps deployed to Azure App Service:
The following NuGet packages provide automatic logging features for apps deployed to Azure App Service:

* [Microsoft.AspNetCore.AzureAppServices.HostingStartup](https://www.nuget.org/packages/Microsoft.AspNetCore.AzureAppServices.HostingStartup/) uses [IHostingStartup](xref:fundamentals/configuration/platform-specific-configuration) to provide ASP.NET Core light-up integration with Azure App Service. The added logging features are provided by the `Microsoft.AspNetCore.AzureAppServicesIntegration` package.
* [Microsoft.AspNetCore.AzureAppServicesIntegration](https://www.nuget.org/packages/Microsoft.AspNetCore.AzureAppServicesIntegration/) executes [AddAzureWebAppDiagnostics](/dotnet/api/microsoft.extensions.logging.azureappservicesloggerfactoryextensions.addazurewebappdiagnostics) to add Azure App Service diagnostics logging providers in the `Microsoft.Extensions.Logging.AzureAppServices` package.
* [Microsoft.Extensions.Logging.AzureAppServices](https://www.nuget.org/packages/Microsoft.Extensions.Logging.AzureAppServices/) provides logger implementations to support Azure App Service diagnostics logs and log streaming features.

If targeting .NET Core and referencing the [Microsoft.AspNetCore.All metapackage](xref:fundamentals/metapackage), the packages are already included. The packages are absent from the newer [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app). If targeting .NET Framework or referencing the `Microsoft.AspNetCore.App` metapackage, reference the individual logging packages.
If targeting .NET Core and referencing the [Microsoft.AspNetCore.All metapackage](xref:fundamentals/metapackage), the preceding packages are included. The packages are absent from the [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app). If targeting .NET Framework or referencing the `Microsoft.AspNetCore.App` metapackage, reference the individual logging packages.

::: moniker-end

Expand Down
42 changes: 30 additions & 12 deletions aspnetcore/host-and-deploy/visual-studio-publish-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ author: rick-anderson
description: Learn how to create publish profiles in Visual Studio and use them for managing ASP.NET Core app deployments to various targets.
ms.author: riande
ms.custom: mvc
ms.date: 04/10/2018
ms.date: 10/24/2018
uid: host-and-deploy/visual-studio-publish-profiles
---
# Visual Studio publish profiles for ASP.NET Core app deployment
Expand All @@ -15,27 +15,43 @@ This document focuses on using Visual Studio 2017 to create and use publish prof

The following project file was created with the command `dotnet new mvc`:

# [ASP.NET Core 2.x](#tab/aspnetcore2x)
::: moniker range=">= aspnetcore-2.1"

```xml
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.4" />
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

</Project>
```

::: moniker-end

::: moniker range="= aspnetcore-2.0"

```xml
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.5" />
</ItemGroup>

</Project>
```

# [ASP.NET Core 1.x](#tab/aspnetcore1x)
::: moniker-end

::: moniker range="< aspnetcore-2.0"

```xml
<Project Sdk="Microsoft.NET.Sdk.Web">
Expand All @@ -45,15 +61,15 @@ The following project file was created with the command `dotnet new mvc`:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.6" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.8" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.3" />
</ItemGroup>

</Project>
```

---
::: moniker-end

The `<Project>` element's `Sdk` attribute accomplishes the following tasks:

Expand Down Expand Up @@ -108,22 +124,24 @@ dotnet publish C:\Webs\Web1

Run the following commands to create and publish a web app:

# [ASP.NET Core 2.x](#tab/aspnetcore2x)
::: moniker range=">= aspnetcore-2.0"

```console
dotnet new mvc
dotnet publish
```

# [ASP.NET Core 1.x](#tab/aspnetcore1x)
::: moniker-end

::: moniker range="< aspnetcore-2.0"

```console
dotnet new mvc
dotnet restore
dotnet publish
```

---
::: moniker-end

The [dotnet publish](/dotnet/core/tools/dotnet-publish) command produces output similar to the following:

Expand Down
18 changes: 17 additions & 1 deletion aspnetcore/migration/mvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,23 @@ Create a new *empty* ASP.NET Core web app with the same name as the previous pro

## Configure the site to use MVC

* When targeting .NET Core, the ASP.NET Core metapackage is added to the project, called `Microsoft.AspNetCore.All` by default. This package contains packages like `Microsoft.AspNetCore.Mvc` and `Microsoft.AspNetCore.StaticFiles`. If targeting .NET Framework, package references need to be listed individually in the *.csproj file.
::: moniker range=">= aspnetcore-2.1"

* When targeting .NET Core, the [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app) is referenced by default. This package contains packages commonly used packages by MVC apps. If targeting .NET Framework, package references must be listed individually in the project file.

::: moniker-end

::: moniker range="= aspnetcore-2.0"

* When targeting .NET Core, the [Microsoft.AspNetCore.All metapackage](xref:fundamentals/metapackage) is referenced by default. This package contains packages commonly used packages by MVC apps. If targeting .NET Framework, package references must be listed individually in the project file.

::: moniker-end

::: moniker range="< aspnetcore-2.0"

* When targeting .NET Core or .NET Framework, packages commonly used packages by MVC apps are listed individually in the project file.

::: moniker-end

`Microsoft.AspNetCore.Mvc` is the ASP.NET Core MVC framework. `Microsoft.AspNetCore.StaticFiles` is the static file handler. The ASP.NET Core runtime is modular, and you must explicitly opt in to serve static files (see [Static files](xref:fundamentals/static-files)).

Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/tutorials/web-api-vsc.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ Press **Debug** (F5) to build and run the program. In a browser, navigate to htt

:::moniker range=">= aspnetcore-2.1"

Creating a new project in ASP.NET Core 2.1 or later adds the [Microsoft.AspNetCore.App](https://www.nuget.org/packages/Microsoft.AspNetCore.App) package reference to the *TodoApi.csproj* file:
Creating a new project in ASP.NET Core 2.1 or later adds the [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app) to the project file:

[!code-xml[](first-web-api/samples/2.1/TodoApi/TodoApi.csproj?name=snippet_Metapackage&highlight=2)]

:::moniker-end

:::moniker range="<= aspnetcore-2.0"

Creating a new project in ASP.NET Core 2.0 adds the [Microsoft.AspNetCore.All](https://www.nuget.org/packages/Microsoft.AspNetCore.All) package reference to the *TodoApi.csproj* file:
Creating a new project in ASP.NET Core 2.0 adds the [Microsoft.AspNetCore.All metapackage](xref:fundamentals/metapackage) to the project file:

[!code-xml[](first-web-api/samples/2.0/TodoApi/TodoApi.csproj?name=snippet_Metapackage&highlight=2)]

Expand Down

0 comments on commit 995514f

Please sign in to comment.