Updated instructions to use latest SDK, cleaned up unnecessary import… (#883)

* Updated instructions to use latest SDK, cleaned up unnecessary imports and added a verification step

* Further simplified the sample

* Revert "Further simplified the sample"

This reverts commit 647bd917d2.
This commit is contained in:
Mete Atamel 2019-03-07 16:56:41 +00:00 committed by Knative Prow Robot
parent 2a8b7e6b3b
commit b88dddbd89
4 changed files with 11 additions and 13 deletions

View File

@ -1,6 +1,6 @@
# Use Microsoft's official .NET image.
# https://hub.docker.com/r/microsoft/dotnet
FROM microsoft/dotnet:2.1-sdk
FROM microsoft/dotnet:2.2-sdk
# Install production dependencies.
# Copy csproj and restore as distinct layers.

View File

@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace helloworld_csharp
{

View File

@ -1,6 +1,6 @@
# Hello World - .NET Core sample
A simple web app written in C# using .NET Core 2.1 that you can use for testing.
A simple web app written in C# using .NET Core 2.2 that you can use for testing.
It reads in an env variable `TARGET` and prints "Hello \${TARGET}!". If TARGET
is not specified, it will use "World" as the TARGET.
@ -11,7 +11,7 @@ is not specified, it will use "World" as the TARGET.
if you need to create one.
- [Docker](https://www.docker.com) installed and running on your local machine,
and a Docker Hub account configured (we'll use it for a container registry).
- You have installed [.NET Core SDK 2.1](https://www.microsoft.com/net/core).
- You have installed [.NET Core SDK 2.2](https://www.microsoft.com/net/core).
## Recreating the sample code
@ -19,6 +19,13 @@ While you can clone all of the code from this directory, hello world apps are
generally more useful if you build them step-by-step. The following instructions
recreate the source files from this folder.
1. First, make sure you have [.NET Core SDK 2.2](https://www.microsoft.com/net/core) installed:
```shell
dotnet --version
2.2.102
```
1. From the console, create a new empty web project using the dotnet command:
```shell
@ -58,7 +65,7 @@ recreate the source files from this folder.
```docker
# Use Microsoft's official .NET image.
# https://hub.docker.com/r/microsoft/dotnet
FROM microsoft/dotnet:2.1-sdk
FROM microsoft/dotnet:2.2-sdk
# Install production dependencies.
# Copy csproj and restore as distinct layers.

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;