Skip to content
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

Update samples to .NET 7 #3989

Merged
merged 10 commits into from
Aug 16, 2022
Merged

Update samples to .NET 7 #3989

merged 10 commits into from
Aug 16, 2022

Conversation

richlander
Copy link
Member

@richlander richlander commented Aug 11, 2022

  • Update samples to .NET 7 (.csproj and Dockerfile)
  • Fix bad patterns I find (I found some)
  • Update docs to reference .NET 7
  • Add non-root sample

# Configure web servers to bind to port 80 when present
ASPNETCORE_URLS=http://+:80 `
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

@@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The complexapp test project also needs to be updated.

@@ -37,12 +37,12 @@ a8" `Y42 a8" "8a 42 42P' `"8a a8P_____42 42
"8a, ,d42 "8a, ,a8" 42, 42 42 "8b, ,aa 42,
`"8bbdP"Y8 `"YbbdP"' "Y428 42 42 `"Ybbd8"' "Y428

.NET 6.0.0
.NET 7.0.0-preview.7.22375.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be appropriate to edit out the version suffix - -preview.7.22375.6


# final stage/image
# Uses the ltsc2022 release; 20H2 and 1809 are other choices
# Uses the ltsc2022 release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment no longer seems useful as the code is self documenting. I see other edits like this removed the entire line.

@mthalman mthalman marked this pull request as ready for review August 16, 2022 12:13
@mthalman mthalman merged commit 56f6d1d into dotnet:main Aug 16, 2022
@richlander richlander deleted the samples7 branch August 16, 2022 13:16
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Produces error if user follows Prerequisites that states .NET 6.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which prerequisites are you referring to?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no idea these instructions existed.

Given that the doc page has a drop-down that allows you to select which .NET version you want, it already had out-of-sync content even prior to this change to .NET 7. For example, if you select the 3.1 version, you still have instructions to clone the same repo which previously was using .NET 6 samples, so still not matching the pre-reqs for that version. As an aside, that version of the doc also specifies the out-of-support 3.0 version in the Dockerfile snippets instead of using 3.1:

FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build

I see two options:

  1. Don't rely on the dotnet-docker repo at all for the project code. Maintain a separate git repo specifically for the docs. I've seen other products do this, like Azure.
  2. Use git tags in the dotnet-docker repo to allow customers to git checkout at a specific tag to be described in the documentation. The git tags would refer to a specific commit in the repo appropriate for that version. So we could have a 3.1-samples tag that, when checked out, would give you the state of the repo when our samples were configured for 3.1. Similarly for other .NET versions.

@ldillonel, as a first step, please log an issue on the docs and link this comment thread. We can discuss further on that issue what the resolution should be.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mthalman I logged the issue on the docs page first. Here's the link dotnet/AspNetCore.Docs#26770

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants