Skip to content

Update samples to use 4.8 #273

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

Merged
merged 1 commit into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The [.NET Framework](https://www.microsoft.com/net/framework) is a general purpo

You can use C#, F# and VB to write .NET Framework apps. C# is simple, powerful, type-safe, and object-oriented while retaining the expressiveness and elegance of C-style languages. F# is a multi-paradigm programming language, enabling both functional and object-oriented patterns and practices. VB is a rapid development programming language with the deepest integration between the language and Visual Studio, providing the fastest path to a working app.

The .NET Framework was first released by Microsoft in 2001. The latest version is [.NET Framework 4.7.2](https://www.microsoft.com/net/framework).
The .NET Framework was first released by Microsoft in 2001. The latest version is [.NET Framework 4.8](https://www.microsoft.com/net/framework).

> https://docs.microsoft.com/dotnet/framework/

Expand Down
4 changes: 2 additions & 2 deletions samples/aspnetapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
Expand All @@ -13,6 +13,6 @@ WORKDIR /app/aspnetapp
RUN msbuild /p:Configuration=Release


FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2 AS runtime
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/aspnetapp/. ./
4 changes: 2 additions & 2 deletions samples/aspnetapp/Dockerfile.windowsservercore-ltsc2016
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
Expand All @@ -13,6 +13,6 @@ WORKDIR /app/aspnetapp
RUN msbuild /p:Configuration=Release


FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2-windowsservercore-ltsc2016 AS runtime
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/aspnetapp/. ./
6 changes: 3 additions & 3 deletions samples/aspnetapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ We recommend that you do not use `--rm` in production. It cleans up container re

## Build the sample locally

You can build this [.NET Framework 4.7.2](https://www.microsoft.com/net/download/dotnet-framework-runtime/net472) application locally with MSBuild and [NuGet](https://www.nuget.org/downloads) using the following instructions. The instructions assume that you are in the root of the repository and using the `Developer Command Prompt for VS 2017`.
You can build this [.NET Framework 4.8](https://www.microsoft.com/net/download/dotnet-framework-runtime/net48) application locally with MSBuild and [NuGet](https://www.nuget.org/downloads) using the following instructions. The instructions assume that you are in the root of the repository and using the `Developer Command Prompt for VS 2019`.

You must have the [.NET Framework 4.7.2 targeting pack](https://go.microsoft.com/fwlink/?LinkId=863261) installed. It is easiest to install with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build) with the Visual Studio Installer.
You must have the [.NET Framework 4.8 targeting pack](http://go.microsoft.com/fwlink/?LinkId=2085167) installed.

```console
cd samples
Expand All @@ -114,7 +114,7 @@ nuget restore
msbuild
```

You can test and debug the application with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build).
You can test and debug the application with [Visual Studio 2019](https://visualstudio.microsoft.com/vs/).

## .NET Core Resources

Expand Down
4 changes: 2 additions & 2 deletions samples/aspnetapp/aspnetapp/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
<httpRuntime targetFramework="4.7.2" />
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.8" />
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
Expand Down
2 changes: 1 addition & 1 deletion samples/aspnetapp/aspnetapp/aspnetapp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>aspnetapp</RootNamespace>
<AssemblyName>aspnetapp</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
Expand Down
4 changes: 2 additions & 2 deletions samples/aspnetmvcapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
Expand All @@ -13,6 +13,6 @@ WORKDIR /app/aspnetmvcapp
RUN msbuild /p:Configuration=Release


FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2 AS runtime
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/aspnetmvcapp/. ./
4 changes: 2 additions & 2 deletions samples/aspnetmvcapp/aspnetmvcapp/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
<httpRuntime targetFramework="4.7.2" />
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.8" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>
Expand Down
2 changes: 1 addition & 1 deletion samples/aspnetmvcapp/aspnetmvcapp/aspnetmvcapp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>aspnetmvcapp</RootNamespace>
<AssemblyName>aspnetmvcapp</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
Expand Down
4 changes: 2 additions & 2 deletions samples/dotnetapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
Expand Down Expand Up @@ -29,7 +29,7 @@ WORKDIR /app/dotnetapp
RUN dotnet publish -c Release -o out


FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
WORKDIR /app
COPY --from=publish /app/dotnetapp/out ./
ENTRYPOINT ["dotnetapp.exe"]
4 changes: 2 additions & 2 deletions samples/dotnetapp/Dockerfile.basic
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
Expand All @@ -14,7 +14,7 @@ WORKDIR /app/dotnetapp
RUN dotnet publish -c Release -o out


FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
WORKDIR /app
COPY --from=build /app/dotnetapp/out ./
ENTRYPOINT ["dotnetapp.exe"]
10 changes: 5 additions & 5 deletions samples/dotnetapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ You can push the image to a container registry so that you can pull and run it o

## Build and run the sample locally with the .NET Core SDK

You can build this [.NET Framework 4.7.2](https://www.microsoft.com/net/download/dotnet-framework-runtime/net472) application locally with the [.NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) using the following instructions. The instructions assume that you are in the root of the repository.
You can build this [.NET Framework 4.8](https://www.microsoft.com/net/download/dotnet-framework-runtime/net48) application locally with the [.NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) using the following instructions. The instructions assume that you are in the root of the repository.

You must have the [.NET Framework 4.7.2 targeting pack](https://go.microsoft.com/fwlink/?LinkId=863261) installed. It is easiest to install with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build) and the the Visual Studio Installer.
You must have the [.NET Framework 4.8 targeting pack](http://go.microsoft.com/fwlink/?LinkId=2085167) installed. It is easiest to install with [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) and the the Visual Studio Installer.

```console
cd samples
Expand All @@ -86,16 +86,16 @@ Note: The `-c release` argument builds the application in release mode (the defa

## Build and run the sample locally with MSBuild

You can build this [.NET Framework 4.7.2](https://www.microsoft.com/net/download/dotnet-framework-runtime/net472) application locally with MSBuild using the following instructions. The instructions assume that you are in the root of the repository and using the `Developer Command Prompt for VS 2017`.
You can build this [.NET Framework 4.8](https://www.microsoft.com/net/download/dotnet-framework-runtime/net48) application locally with MSBuild using the following instructions. The instructions assume that you are in the root of the repository and using the `Developer Command Prompt for VS 2019`.

You must have the [.NET Framework 4.7.2 targeting pack](https://go.microsoft.com/fwlink/?LinkId=863261) installed. It is easiest to install with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build) and the the Visual Studio Installer.
You must have the [.NET Framework 4.8 targeting pack](https://go.microsoft.com/fwlink/?LinkId=2085167) installed. It is easiest to install with [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) and the the Visual Studio Installer.

```console
cd samples
cd dotnetapp
msbuild /t:restore
msbuild /p:Configuration=Release
dotnetapp\bin\Release\net471\dotnetapp.exe
dotnetapp\bin\Release\net48\dotnetapp.exe
```

Note: The `/p:Configuration=Release` argument builds the application in release mode (the default is debug mode). See the [MSBuild Command-Line reference](https://msdn.microsoft.com/en-us/library/ms164311.aspx) for more information on commandline parameters.
Expand Down
2 changes: 1 addition & 1 deletion samples/dotnetapp/dotnetapp/dotnetapp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/dotnetapp/tests/tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/wcfapp/Dockerfile.client
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app
COPY WcfClient/. .
RUN msbuild /p:Configuration=Release

FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
WORKDIR /app
COPY --from=build /app/bin/Release .
ENTRYPOINT WcfClient.exe
4 changes: 2 additions & 2 deletions samples/wcfapp/Dockerfile.console
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app
COPY WcfServiceConsoleApp/. .
RUN msbuild /p:Configuration=Release

FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
EXPOSE 80
EXPOSE 808
WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions samples/wcfapp/Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app
COPY WcfServiceWebApp/. .
RUN msbuild /p:Configuration=Release

FROM mcr.microsoft.com/dotnet/framework/wcf:4.7.2 AS runtime
FROM mcr.microsoft.com/dotnet/framework/wcf:4.8 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/ .
8 changes: 4 additions & 4 deletions samples/wcfapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can also [download the repository as a zip](https://github.com/microsoft/dot
WCF service is supported on .NET Framework, which can run in Windows Server Core based containers. For simplicity, we disabled security in these samples.

### Build a Container with IIS-hosted WCF Service
Project `WcfServiceWebApp` is created from 'WCF Service Application' template in Visual Studio. A [Dockerfile](/Dockerfile.web) is added to the project. We use a [WCF image](https://hub.docker.com/_/microsoft-dotnet-framework-wcf/) as the base image, which has both HTTP and NET.TCP protocols enabled in IIS and exposes ports 80 (for HTTP) and 808 (for NET.TCP) for the container. We use the WCF image with tag `4.7.2` for .NET Framework 4.7.2 in this example, but you can change it to use other tags (eg. `4.7`) for WCF images with different versions of .NET Framework. The complete list of supported WCF tags can be found on [Docker Hub](https://hub.docker.com/_/microsoft-dotnet-framework-wcf/).
Project `WcfServiceWebApp` is created from 'WCF Service Application' template in Visual Studio. A [Dockerfile](/Dockerfile.web) is added to the project. We use a [WCF image](https://hub.docker.com/_/microsoft-dotnet-framework-wcf/) as the base image, which has both HTTP and NET.TCP protocols enabled in IIS and exposes ports 80 (for HTTP) and 808 (for NET.TCP) for the container. We use the WCF image with tag `4.8` for .NET Framework 4.8 in this example, but you can change it to use other tags (eg. `4.7.2`) for WCF images with different versions of .NET Framework. The complete list of supported WCF tags can be found on [Docker Hub](https://hub.docker.com/_/microsoft-dotnet-framework-wcf/).

Run commands below to build the container image with name `iishostedwcfservice` and start an instance of it named `myservice1`. Docker parameter `-d` will run the container in background (detached mode).
```
Expand Down Expand Up @@ -95,9 +95,9 @@ docker-compose -f docker-compose-selfhosted.yml up

## Build the sample locally

You can build this [.NET Framework 4.7.2](https://www.microsoft.com/net/download/dotnet-framework-runtime/net472) application locally with MSBuild using the following instructions. The instructions assume that you are in the root of the repository and using the `Developer Command Prompt for VS 2017`.
You can build this [.NET Framework 4.8](https://www.microsoft.com/net/download/dotnet-framework-runtime/net48) application locally with MSBuild using the following instructions. The instructions assume that you are in the root of the repository and using the `Developer Command Prompt for VS 2019`.

You must have the [.NET Framework 4.7.2 targeting pack](https://go.microsoft.com/fwlink/?LinkId=863261) installed. It is easiest to install with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build) with the Visual Studio Installer.
You must have the [.NET Framework 4.8 targeting pack](https://go.microsoft.com/fwlink/?LinkId=2085167) installed. It is easiest to install with [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) with the Visual Studio Installer.

```console
cd samples
Expand All @@ -106,7 +106,7 @@ msbuild wcfapp.sln /p:Configuration=Release
```

Note: The /p:Configuration=Release argument builds the application in release mode (the default is debug mode). See the [MSBuild Command-Line reference](https://msdn.microsoft.com/en-us/library/ms164311.aspx) for more information on commandline parameters.
You can also build, test and debug the application with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build).
You can also build, test and debug the application with [Visual Studio 2019](https://visualstudio.microsoft.com/vs/).

## .NET Resources

Expand Down
2 changes: 1 addition & 1 deletion samples/wcfapp/WcfClient/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
2 changes: 1 addition & 1 deletion samples/wcfapp/WcfClient/WcfClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>WcfClient</RootNamespace>
<AssemblyName>WcfClient</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
Expand Down
2 changes: 1 addition & 1 deletion samples/wcfapp/WcfServiceConsoleApp/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<system.serviceModel>
<behaviors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>WcfServiceConsoleApp</RootNamespace>
<AssemblyName>WcfServiceConsoleApp</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
Expand Down
2 changes: 1 addition & 1 deletion samples/wcfapp/WcfServiceWebApp/WcfServiceWebApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WcfServiceWebApp</RootNamespace>
<AssemblyName>WcfServiceWebApp</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<UseIISExpress>true</UseIISExpress>
Expand Down
6 changes: 3 additions & 3 deletions samples/wcfapp/WcfServiceWebApp/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.7.2" />
<httpRuntime targetFramework="4.8" />
</system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.7.2"/>
<httpRuntime targetFramework="4.7.2"/>
<compilation debug="true" targetFramework="4.8"/>
<httpRuntime targetFramework="4.8"/>
</system.web>
<system.serviceModel>
<services>
Expand Down