Aspnetcore.docs: PROPOSAL: Update or add some ASP.NET Core code samples to use ASP.NET Core 2.0

Created on 6 Dec 2017  路  11Comments  路  Source: dotnet/AspNetCore.Docs

General

Some current topics in ASP.NET Core docs have sample codes and explanations that are valid for ASP.NET Core 1.0.
For example, these are ASP.NET Core topics that use ASP.NET Core 1.0 code: (these are even using obsoleted xproj)

Issues with Existing Topics

Those docs and the sample codes above are using ASP.NET Core 1.0, and it will be not valid or not usable for ASP.NET Core 2.0 (hence not usable for .NET Core 2.0). Therefore those topics and the sample codes should be updated to ASP.NET.
Also the code samples in those topics are still using x-plat xproj model instead of newer .NET Core csproj in VS 2017.

Proposal intents

  1. Update the docs and code samples as needed, we should use ASP.NET Core 2.0 instead of ASP.NET Core 1.0.
  2. Use VS 2017 at least 15.4.0 to ensure smooth use of ASP.NET Core 2.0 and .NET Core 2.0 as base IDE to write updated code samples. We could also use VS Code at least version 1.17, only if we want to ensure that the code will work for VS Code too. The use of VS Code will appeal to broader audiences 馃檪
  3. Add necessary update on the title if necessary.
  4. If multi version of ASP.NET Core is needed in the topics, then the sample code folders need to be updated for these changes.

Questions:

  • Could I specify the use of VS 2017 15.4.x as the minimal version of Visual Studio to use?

NOTE:

  • If my proposal is accepted, I'll open a new issue to track pages and sample codes that needs to be updated

cc @scottaddie , @Rick-Anderson

Most helpful comment

@eriawan we would like to update all the samples/docs to 2.0 but also retain the 1.x version and docs.

Use the following tab markup:

# [ASP.NET Core 2.x](#tab/aspnetcore2x)
<!-- [ASP.NET Core 2.x goes here -->
# [ASP.NET Core 1.x](#tab/aspnetcore1x)
<!-- [ASP.NET Core 1.x goes here -->
The following line ends the tab content.
------

Create 1 issue per doc you will be updating. DI sounds like a good one to start on.

All 11 comments

This proposal is also valid useful to address this issue #4850 that use ASP.NET Core 1.0 specific code that needs to be updated, based on the comment from Geoffrey_Braaf:
https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies

IMHO, this issue is already taken by @scottaddie , so I will not fix the custom policy page. CMIIW, though..

@eriawan we would like to update all the samples/docs to 2.0 but also retain the 1.x version and docs.

Use the following tab markup:

# [ASP.NET Core 2.x](#tab/aspnetcore2x)
<!-- [ASP.NET Core 2.x goes here -->
# [ASP.NET Core 1.x](#tab/aspnetcore1x)
<!-- [ASP.NET Core 1.x goes here -->
The following line ends the tab content.
------

Create 1 issue per doc you will be updating. DI sounds like a good one to start on.

@eriawan I am indeed nearing completion on that Policy Authorization doc.

If you create new ASP.NET Core 2.0 sample apps, Razor Pages is generally preferred over MVC.

@Rick-Anderson

Create 1 issue per doc you will be updating. DI sounds like a good one to start on.

The download sample code on the DI page points to sample code that use ASP.NET Core 1.0.
How should we handle this? Should we leave the sample as is and add a new ASP.NET Core 2.0 sample code by having 2 folders of ASP.NET Core 1.0 and 2.0 separately?
I mean, for example, instead of the existing folder structure of /aspnetcore/fundamentals/dependency-injection/sample; we will use folder structure of /aspnetcore/fundamentals/dependency-injection/1.0 for ASP.NET Core 1.0, and /aspnetcore/fundamentals/dependency-injection/2.0 for ASP.NET Core 2.0.

@scottaddie

If you create new ASP.NET Core 2.0 sample apps, Razor Pages is generally preferred over MVC.

Thanks for the suggestion! Cool, I will use Razor Pages for those planned updated sample of ASP.NET Core 2.0 codes.

@eriawan Here's an example of how I handled it in a different doc: https://github.com/aspnet/Docs/tree/master/aspnetcore/security/authorization/resourcebased/samples.

@scottaddie
Quite simple. Thanks, I'm starting to work on updating them now.

@eriawan Have you started working on the middleware sample yet? I ask because I'm about to put in a PR that will move the middleware sample in the TOC. If you haven't started working on that yet, you might want to hold off for just a couple of days until the dust settles on this PR. If you have, no worries, we'll just have to deal with any conflicts as they arise.

@guardrex
I'm still working on the DI and the middleware sample.

Looks like work here stopped, and this issue is superseded by https://github.com/aspnet/Docs/issues/5495.

ah, you got me first, @guardrex :)

ok, thanks for the updates

Was this page helpful?
0 / 5 - 0 ratings