-
Notifications
You must be signed in to change notification settings - Fork 25.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logging 2.1 to 2.2/3.0 migration guide #10122
Conversation
cc @ajcvickers |
@pakrym We usually use our in-topic versioning (in this case, in the Logging topic) to cover updates to the framework and then call out the migration steps in the migration topic (in this case, Migrate from ASP.NET Core 2.1 to 2.2). Idk what they'll suggest, but the pattern has been not to have migration topics in the Fundamentals node. Pinging Sir @tdykstra for help. |
That's right, this should go in https://github.com/aspnet/Docs/blob/master/aspnetcore/migration/21-to-22.md. We don't have a place for the 3.0 instructions yet, but they will end up in a 3.0 migration doc located in the same folder. |
Should I make two copies of this doc then? |
There are also some parts that are not ASP.NET Core specific and apply to console apps too. |
There's an outstanding issue for writing logging docs that aren't ASP.NET Core-specific -- Until that is resolved I would put the 2.1 to 2.2 content in the 2.1 to 2.2 doc, and publish the non-ASP.NET-Core content and the 3.0 content in a blog for now. Considering the dialog in aspnet/Logging#932, I would also link from the logging doc to the new 2.1 to 2.2 logging section of the migration doc to make that more discoverable. cc @Rick-Anderson in cases he has any other ideas about where to put non-ASP.NET Core and migrate-to-3.0 content. |
What about blogging the 3.0 and non-ASP.NET parts? |
I think they might need to be referenced from EF logging doc (https://docs.microsoft.com/en-us/ef/core/miscellaneous/logging) |
We could add the non-ASP.NET Core content there until we get a permanent home for it, that leaves 3.0. Maybe just start a 2.2-to-3.0 migration doc that only has this logging content in it for now? |
So if this plan makes sense, I'll
|
I'm not a fan of this part, while it's non-ASP.NET Core content it's even less EF specific. I would prefer having it in ASP.NET Core migration doc over EF. |
It's out of place there, but we don't have a better place for it, so I could put it there and link to it from the EF doc. |
@tdykstra can we S&M this? You can move this to a new (very small) 2.2 to 3.0 migration doc after. |
Better to avoid that, it creates a new URL which we would then have to redirect and we wouldn't have a single logical target to redirect to. I'll take care of it tomorrow. |
But don't we eventually need a 2.2 to 3.0 migration doc? |
Not in the fundamentals/logging folder |
In the migrations folder. |
Once I realized the only 3.0 content was for non-ASP.NET Core apps, it no longer made sense to put it in a new ASP.NET Core migration doc, so I ended up with this:
I had already created the new 2.2 to 3.0 migration doc for #9490 before deciding the logging content didn't fit, so I'm including it as well. |
aspnetcore/migration/22-to-30.md
Outdated
|
||
* Remove the `<PackageReference>` to `Microsoft.AspNetCore.All` and `Microsoft.AspNetCore.App`. | ||
|
||
**Preview 1 Known Issue** - workaround for NuGet/Home#7342 - projects that do not start with `<Project Sdk="Microsoft.NET.Sdk.Web">` will get compiler or runtime errors due to missing Microsoft.AspNetCore.* assemblies. This is most often the case for test projects and class libraries. The workaround is to add the following to the *.csproj* file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a link out of NuGet/Home#7342
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a proper WARNING here?
**Preview 1 Known Issue** - workaround for NuGet/Home#7342 - projects that do not start with `<Project Sdk="Microsoft.NET.Sdk.Web">` will get compiler or runtime errors due to missing Microsoft.AspNetCore.* assemblies. This is most often the case for test projects and class libraries. The workaround is to add the following to the *.csproj* file. | |
> [!WARNING] | |
> **Preview 1 Known Issue** | |
> | |
> Projects that don't start with `<Project Sdk="Microsoft.NET.Sdk.Web">` receive compiler or runtime errors due to missing `Microsoft.AspNetCore.*` assemblies. This is most often the case for test projects and class libraries. The workaround is to add the following to the *.csproj* file: | |
> | |
> ```xml | |
> <ItemGroup> | |
> <FrameworkReference Include="Microsoft.AspNetCore.App" /> | |
> </ItemGroup> | |
> ``` | |
> | |
> For more information, see [Represent FrameworkReferences in NuGet packages and assets files (NuGet/Home #7342)](https://github.com/NuGet/Home/issues/7342). |
aspnetcore/migration/22-to-30.md
Outdated
</ItemGroup> | ||
``` | ||
|
||
* Update the `Version` on remaining `<PackageReference>` elements for `Microsoft.AspNetCore.*` packages to 3.0.0-preview-18579-0053 (or whatever the number is for the current Preview) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the Version
on remaining <PackageReference>
elements for Microsoft.AspNetCore.*
packages to the current preview (for example, 3.0.0-preview-18579-0053).
aspnetcore/migration/22-to-30.md
Outdated
|
||
* Update the `Version` on remaining `<PackageReference>` elements for `Microsoft.AspNetCore.*` packages to 3.0.0-preview-18579-0053 (or whatever the number is for the current Preview) | ||
|
||
If there is no 3.0 version of a package, the package might have been deprecated in 3.0. Many of these are part of `Microsoft.AspNetCore.App` and don't need to be referenced individually anymore. For a preliminary list of packages no longer produced in 3.0, see https://github.com/aspnet/AspNetCore/issues/3756. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of these are part of Microsoft.AspNetCore.App
and don't need to be referenced individually anymore~. Better Many of these are part of
Microsoft.AspNetCore.App` and should not be referenced individually.
Is there a list of deprecated packages in 3.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a list of deprecated packages in 3.0?
aspnetcore/migration/22-to-30.md
Outdated
|
||
If there is no 3.0 version of a package, the package might have been deprecated in 3.0. Many of these are part of `Microsoft.AspNetCore.App` and don't need to be referenced individually anymore. For a preliminary list of packages no longer produced in 3.0, see https://github.com/aspnet/AspNetCore/issues/3756. | ||
|
||
* Some APIs were removed from Microsoft.AspNetCore.App between 2.x and 3.0. You may need to add `<PackageReference>` items if you're using API from packages listed in https://github.com/aspnet/AspNetCore/issues/3755 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some assemblies were removed from Microsoft.AspNetCore.App between 2.x and 3.0. You may need to add <PackageReference>
items if you're using APIs from packages listed in dotnet/aspnetcore#3755
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always include the title in these types of issue links. Suggestion (this is what I use) ...
[Assemblies being removed from Microsoft.AspNetCore.App 3.0 (aspnet/AspNetCore #3755)](https://github.com/dotnet/aspnetcore/issues/3755)
aspnetcore/migration/22-to-30.md
Outdated
|
||
* Some APIs were removed from Microsoft.AspNetCore.App between 2.x and 3.0. You may need to add `<PackageReference>` items if you're using API from packages listed in https://github.com/aspnet/AspNetCore/issues/3755 | ||
|
||
For example, Entity Framework Core and System.Data.SqlClient are no longer part of Microsoft.AspNetCore.App. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to code-fence packages. They're code in the project file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tdykstra can you review my suggestions and apply as appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and we pretty much always link to our metapackage topic (with the word "metapackage" in the link) ...
[Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reminds me that I need to submit a version selector moniker request for ASP.NET Core 3.0. I'll submit that request right now.
@@ -0,0 +1,2 @@ | |||
* [Visual Studio 2017 version 15.9 or later](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the campaign link to allow tracking:
* [Visual Studio 2017 version 15.9 or later](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload | |
* [Visual Studio 2017 version 15.9 or later](https://www.visualstudio.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=button+cta&utm_content=download+vs2017) with the **ASP.NET and web development** workload |
Also, I suspect VS 2019 will be required when 3.0 releases. Do we have an issue to update prereqs accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I suspect VS 2019 will be required when 3.0 releases. Do we have an issue to update prereqs accordingly?
I don't think we have been creating a dedicated issue for updating prereq includes each release. I would wait until VS 2019 becomes required; that'll be the sort of change that we won't need a reminder to change prereqs for.
@@ -0,0 +1,2 @@ | |||
* [Visual Studio 2017 version 15.9 or later](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload | |||
* [.NET Core SDK 3.0 Preview](https://www.microsoft.com/net/download/all) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider future-proofing this text by dropping the "Preview" moniker:
* [.NET Core SDK 3.0 Preview](https://www.microsoft.com/net/download/all) | |
* [.NET Core SDK 3.0](https://www.microsoft.com/net/download/all) |
aspnetcore/migration/21-to-22.md
Outdated
@@ -142,6 +142,77 @@ Change the `FROM` lines in your *Dockerfile* to use the new image tags in the pr | |||
|
|||
Visual Studio's **Auto build on browser request** experience doesn't function with the [IIS in-process hosting model](xref:fundamentals/servers/index#in-process-hosting-model). You must manually rebuild the project when using in-process hosting. Improvements to this experience are planned for a future release of Visual Studio. | |||
|
|||
## Update logging code | |||
|
|||
* Move logging provider initialization to `ConfigureServices`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Move logging provider initialization to `ConfigureServices`. | |
* Move logging provider initialization to `Startup.ConfigureServices`. |
aspnetcore/migration/21-to-22.md
Outdated
} | ||
``` | ||
|
||
* Change filtering to use `AddLogging` builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Change filtering to use `AddLogging` builder. | |
* Change filtering to use the `AddLogging` builder. |
aspnetcore/migration/21-to-22.md
Outdated
} | ||
``` | ||
|
||
* Change configuration loading to use `AddLogging` builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Change configuration loading to use `AddLogging` builder. | |
* Change configuration loading to use the `AddLogging` builder. |
aspnetcore/migration/22-to-30.md
Outdated
|
||
If there is no 3.0 version of a package, the package might have been deprecated in 3.0. Many of these are part of `Microsoft.AspNetCore.App` and should not be referenced individually anymore. For a preliminary list of packages no longer produced in 3.0, see [aspnet/AspNetCore #3756](https://github.com/aspnet/AspNetCore/issues/3756). | ||
|
||
* Some assemblies were removed from Microsoft.AspNetCore.App between 2.x and 3.0. You may need to add `<PackageReference>` items if you're using APIs from packages listed in [aspnet/AspNetCore #3755](https://github.com/aspnet/AspNetCore/issues/3755) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Some assemblies were removed from Microsoft.AspNetCore.App between 2.x and 3.0. You may need to add `<PackageReference>` items if you're using APIs from packages listed in [aspnet/AspNetCore #3755](https://github.com/aspnet/AspNetCore/issues/3755) | |
* Some assemblies were removed from `Microsoft.AspNetCore.App` between 2.x and 3.0. You may need to add `<PackageReference>` items if you're using APIs from packages listed in [aspnet/AspNetCore #3755](https://github.com/aspnet/AspNetCore/issues/3755) |
aspnetcore/migration/22-to-30.md
Outdated
|
||
* Some assemblies were removed from Microsoft.AspNetCore.App between 2.x and 3.0. You may need to add `<PackageReference>` items if you're using APIs from packages listed in [aspnet/AspNetCore #3755](https://github.com/aspnet/AspNetCore/issues/3755) | ||
|
||
For example, `Microsoft.EntityFrameworkCore` and `System.Data.SqlClient` are no longer part of Microsoft.AspNetCore.App. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, `Microsoft.EntityFrameworkCore` and `System.Data.SqlClient` are no longer part of Microsoft.AspNetCore.App. | |
For example, `Microsoft.EntityFrameworkCore` and `System.Data.SqlClient` are no longer part of `Microsoft.AspNetCore.App`. |
aspnetcore/migration/22-to-30.md
Outdated
|
||
For example, `Microsoft.EntityFrameworkCore` and `System.Data.SqlClient` are no longer part of Microsoft.AspNetCore.App. | ||
|
||
**Preview 1 Known Issue** - the list of assemblies shipping in `Microsoft.AspNetCore.App` has not been finalized yet and will change before 3.0 RTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Preview 1 Known Issue** - the list of assemblies shipping in `Microsoft.AspNetCore.App` has not been finalized yet and will change before 3.0 RTM. | |
**Preview 1 Known Issue** - the list of assemblies shipping in `Microsoft.AspNetCore.App` hasn't been finalized yet and will change before 3.0 RTM. |
|
||
## 2.1 to 3.0 | ||
|
||
In 3.0 use `LoggingFactory.Create`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 3.0 use `LoggingFactory.Create`. | |
In 3.0, use `LoggingFactory.Create`. |
aspnetcore/toc.md
Outdated
@@ -392,6 +392,7 @@ | |||
## [Use a file watcher](xref:tutorials/dotnet-watch) | |||
|
|||
# Migration | |||
## [2.2 to 3.0 ](xref:migration/22-to-30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## [2.2 to 3.0 ](xref:migration/22-to-30) | |
## [2.2 to 3.0](xref:migration/22-to-30) |
@@ -0,0 +1,2 @@ | |||
* [Visual Studio for Mac version 7.7 or later](https://www.visualstudio.com/downloads/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to land on https://visualstudio.microsoft.com/vs/mac/ than that downloads page. Seems more focused and friendly for Mac users.
@@ -0,0 +1,2 @@ | |||
* [Visual Studio 2017 version 15.9 or later](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload | |||
* [.NET Core SDK 3.0 Preview](https://www.microsoft.com/net/download/all) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this link is tied directly to the 3.0 preview, it could go directly there 👉 https://dotnet.microsoft.com/download/dotnet-core/3.0
Otherwise, this link (as you have it, if you keep it) redirects to 👉 https://dotnet.microsoft.com/download/archives
|
||
[!INCLUDE[](~/includes/net-core-prereqs-mac-3.0.md)] | ||
|
||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something, but no CLI tab with a CLI INCLUDE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following what we have for 2.2. Tabs are VS, VSC, VSMac.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# [.NET Core CLI](#tab/netcore-cli)
@@ -0,0 +1,3 @@ | |||
* [Visual Studio Code](https://code.visualstudio.com/download) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As before, I personally would prefer to hit the nice looking main product page ... it's simple enough to download directly from there.
aspnetcore/migration/21-to-22.md
Outdated
@@ -142,6 +142,77 @@ Change the `FROM` lines in your *Dockerfile* to use the new image tags in the pr | |||
|
|||
Visual Studio's **Auto build on browser request** experience doesn't function with the [IIS in-process hosting model](xref:fundamentals/servers/index#in-process-hosting-model). You must manually rebuild the project when using in-process hosting. Improvements to this experience are planned for a future release of Visual Studio. | |||
|
|||
## Update logging code | |||
|
|||
* Move logging provider initialization to `ConfigureServices`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Move logging provider initialization to `ConfigureServices`. | |
* Move logging provider initialization to `Startup.ConfigureServices`. |
ms.date: 01/04/2019 | ||
uid: migration/logging-nonaspnetcore | ||
--- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't been putting a blank line here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line ... I actually went thru ages ago and made this consistent. Recommend that we don't put a blank line under the metadata or that we set up a PR to do it for every topic. My obsessive-compulsive disorder is showing! 😄 lol
|
||
2.1 example: | ||
|
||
``` C# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` C# | |
```csharp |
|
||
2.2 example: | ||
|
||
``` C# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` C# | |
```csharp |
|
||
2.1 example: | ||
|
||
``` C# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` C# | |
```csharp |
|
||
3.0 example: | ||
|
||
``` C# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` C# | |
```csharp |
@tdykstra Another commit coming? ... there are still "C#" code language markers and here's the tab for the CLI if you want to create (or use an existing) INCLUDE ...
|
@guardrex On the tabs I'll stick with what we're doing for 2.2. VSC and Mac use the CLI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining remarks are nits.
aspnetcore/migration/22-to-30.md
Outdated
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
``` | ||
|
||
* Remove any `<PackageReference>` to [Microsoft.AspNetCore.All](xref:fundamentals/metapackage)` or [Microsoft.AspNetCore.App](xref:fundamentals/metapackage-app). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK (without much discussion on it), Rick, Scott, and I adopted a pattern while you were away. The links to the metapackage topics will say "metapackage" in the link, so I suggest (and there's a stray backtick there, too) ...
* Remove any `<PackageReference>` to [Microsoft.AspNetCore.All](xref:fundamentals/metapackage)` or [Microsoft.AspNetCore.App](xref:fundamentals/metapackage-app). | |
* Remove any `<PackageReference>` to [Microsoft.AspNetCore.All metapackage](xref:fundamentals/metapackage) or [Microsoft.AspNetCore.App metapackage](xref:fundamentals/metapackage-app). |
aspnetcore/migration/22-to-30.md
Outdated
|
||
* Remove any `<PackageReference>` to [Microsoft.AspNetCore.All](xref:fundamentals/metapackage)` or [Microsoft.AspNetCore.App](xref:fundamentals/metapackage-app). | ||
|
||
**Preview 1 Known Issue** - workaround for [NuGet/Home #7342](https://github.com/NuGet/Home/issues/7342) - projects that don't start with `<Project Sdk="Microsoft.NET.Sdk.Web">` will get compiler or runtime errors due to missing `Microsoft.AspNetCore.*` assemblies. This is most often the case for test projects and class libraries. The workaround is to add the following to the *.csproj* file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh ... imo, this doesn't look good and the future tense isn't necessary ... but ok.
aspnetcore/migration/22-to-30.md
Outdated
|
||
For example, `Microsoft.EntityFrameworkCore` and `System.Data.SqlClient` are no longer part of `Microsoft.AspNetCore.App`. | ||
|
||
**Preview 1 Known Issue** - the list of assemblies shipping in `Microsoft.AspNetCore.App` hasn't been finalized yet and will change before 3.0 RTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
ms.date: 01/04/2019 | ||
uid: migration/logging-nonaspnetcore | ||
--- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line ... I actually went thru ages ago and made this consistent. Recommend that we don't put a blank line under the metadata or that we set up a PR to do it for every topic. My obsessive-compulsive disorder is showing! 😄 lol
I hope you'll confer tho on that point. IMO, it would be better to always have all of the tabs. There are devs who like CLI things. It's not obvious to those devs what these IDEs are using. Anyway ... it's just a nit. |
@guardrex I addressed some of the nits, though not quite exactly the way you had in mind. 😄
Will do |
Fixes: #9841
Fixes #9490