Skip to content

Commit d2b68d4

Browse files
authored
Update samples to use 4.8 (#273)
1 parent cd6a910 commit d2b68d4

24 files changed

+45
-45
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The [.NET Framework](https://www.microsoft.com/net/framework) is a general purpo
1414

1515
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.
1616

17-
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).
17+
The .NET Framework was first released by Microsoft in 2001. The latest version is [.NET Framework 4.8](https://www.microsoft.com/net/framework).
1818

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

samples/aspnetapp/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33

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

1515

16-
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2 AS runtime
16+
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8 AS runtime
1717
WORKDIR /inetpub/wwwroot
1818
COPY --from=build /app/aspnetapp/. ./

samples/aspnetapp/Dockerfile.windowsservercore-ltsc2016

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33

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

1515

16-
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2-windowsservercore-ltsc2016 AS runtime
16+
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016 AS runtime
1717
WORKDIR /inetpub/wwwroot
1818
COPY --from=build /app/aspnetapp/. ./

samples/aspnetapp/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ We recommend that you do not use `--rm` in production. It cleans up container re
103103

104104
## Build the sample locally
105105

106-
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`.
106+
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`.
107107

108-
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.
108+
You must have the [.NET Framework 4.8 targeting pack](http://go.microsoft.com/fwlink/?LinkId=2085167) installed.
109109

110110
```console
111111
cd samples
@@ -114,7 +114,7 @@ nuget restore
114114
msbuild
115115
```
116116

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

119119
## .NET Core Resources
120120

samples/aspnetapp/aspnetapp/Web.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
-->
66
<configuration>
77
<system.web>
8-
<compilation debug="true" targetFramework="4.7.2" />
9-
<httpRuntime targetFramework="4.7.2" />
8+
<compilation debug="true" targetFramework="4.8" />
9+
<httpRuntime targetFramework="4.8" />
1010
<pages>
1111
<namespaces>
1212
<add namespace="System.Web.Optimization" />

samples/aspnetapp/aspnetapp/aspnetapp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<AppDesignerFolder>Properties</AppDesignerFolder>
1616
<RootNamespace>aspnetapp</RootNamespace>
1717
<AssemblyName>aspnetapp</AssemblyName>
18-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
18+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1919
<UseIISExpress>true</UseIISExpress>
2020
<Use64BitIISExpress />
2121
<IISExpressSSLPort />

samples/aspnetmvcapp/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33

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

1515

16-
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2 AS runtime
16+
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8 AS runtime
1717
WORKDIR /inetpub/wwwroot
1818
COPY --from=build /app/aspnetmvcapp/. ./

samples/aspnetmvcapp/aspnetmvcapp/Web.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
1212
</appSettings>
1313
<system.web>
14-
<compilation debug="true" targetFramework="4.7.2" />
15-
<httpRuntime targetFramework="4.7.2" />
14+
<compilation debug="true" targetFramework="4.8" />
15+
<httpRuntime targetFramework="4.8" />
1616
<httpModules>
1717
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
1818
</httpModules>

samples/aspnetmvcapp/aspnetmvcapp/aspnetmvcapp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<AppDesignerFolder>Properties</AppDesignerFolder>
1616
<RootNamespace>aspnetmvcapp</RootNamespace>
1717
<AssemblyName>aspnetmvcapp</AssemblyName>
18-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
18+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1919
<MvcBuildViews>false</MvcBuildViews>
2020
<UseIISExpress>true</UseIISExpress>
2121
<Use64BitIISExpress />

samples/dotnetapp/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33

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

3131

32-
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
32+
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
3333
WORKDIR /app
3434
COPY --from=publish /app/dotnetapp/out ./
3535
ENTRYPOINT ["dotnetapp.exe"]

samples/dotnetapp/Dockerfile.basic

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33

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

1616

17-
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
17+
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
1818
WORKDIR /app
1919
COPY --from=build /app/dotnetapp/out ./
2020
ENTRYPOINT ["dotnetapp.exe"]

samples/dotnetapp/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ You can push the image to a container registry so that you can pull and run it o
6060

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

63-
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.
63+
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.
6464

65-
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.
65+
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.
6666

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

8787
## Build and run the sample locally with MSBuild
8888

89-
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`.
89+
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`.
9090

91-
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.
91+
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.
9292

9393
```console
9494
cd samples
9595
cd dotnetapp
9696
msbuild /t:restore
9797
msbuild /p:Configuration=Release
98-
dotnetapp\bin\Release\net471\dotnetapp.exe
98+
dotnetapp\bin\Release\net48\dotnetapp.exe
9999
```
100100

101101
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.

samples/dotnetapp/dotnetapp/dotnetapp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net472</TargetFramework>
5+
<TargetFramework>net48</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

samples/dotnetapp/tests/tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net472</TargetFramework>
4+
<TargetFramework>net48</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

samples/wcfapp/Dockerfile.client

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33
COPY WcfClient/. .
44
RUN msbuild /p:Configuration=Release
55

6-
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
6+
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
77
WORKDIR /app
88
COPY --from=build /app/bin/Release .
99
ENTRYPOINT WcfClient.exe

samples/wcfapp/Dockerfile.console

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33
COPY WcfServiceConsoleApp/. .
44
RUN msbuild /p:Configuration=Release
55

6-
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2 AS runtime
6+
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime
77
EXPOSE 80
88
EXPOSE 808
99
WORKDIR /app

samples/wcfapp/Dockerfile.web

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS build
1+
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
22
WORKDIR /app
33
COPY WcfServiceWebApp/. .
44
RUN msbuild /p:Configuration=Release
55

6-
FROM mcr.microsoft.com/dotnet/framework/wcf:4.7.2 AS runtime
6+
FROM mcr.microsoft.com/dotnet/framework/wcf:4.8 AS runtime
77
WORKDIR /inetpub/wwwroot
88
COPY --from=build /app/ .

samples/wcfapp/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You can also [download the repository as a zip](https://github.com/microsoft/dot
3636
WCF service is supported on .NET Framework, which can run in Windows Server Core based containers. For simplicity, we disabled security in these samples.
3737

3838
### Build a Container with IIS-hosted WCF Service
39-
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/).
39+
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/).
4040

4141
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).
4242
```
@@ -95,9 +95,9 @@ docker-compose -f docker-compose-selfhosted.yml up
9595

9696
## Build the sample locally
9797

98-
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`.
98+
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`.
9999

100-
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.
100+
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.
101101

102102
```console
103103
cd samples
@@ -106,7 +106,7 @@ msbuild wcfapp.sln /p:Configuration=Release
106106
```
107107

108108
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.
109-
You can also build, test and debug the application with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build).
109+
You can also build, test and debug the application with [Visual Studio 2019](https://visualstudio.microsoft.com/vs/).
110110

111111
## .NET Resources
112112

samples/wcfapp/WcfClient/App.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
55
</startup>
66
</configuration>

samples/wcfapp/WcfClient/WcfClient.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<OutputType>Exe</OutputType>
99
<RootNamespace>WcfClient</RootNamespace>
1010
<AssemblyName>WcfClient</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<TargetFrameworkProfile />

samples/wcfapp/WcfServiceConsoleApp/App.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
55
</startup>
66
<system.serviceModel>
77
<behaviors>

samples/wcfapp/WcfServiceConsoleApp/WcfServiceConsoleApp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<OutputType>Exe</OutputType>
99
<RootNamespace>WcfServiceConsoleApp</RootNamespace>
1010
<AssemblyName>WcfServiceConsoleApp</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>

samples/wcfapp/WcfServiceWebApp/WcfServiceWebApp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<AppDesignerFolder>Properties</AppDesignerFolder>
1313
<RootNamespace>WcfServiceWebApp</RootNamespace>
1414
<AssemblyName>WcfServiceWebApp</AssemblyName>
15-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
15+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1616
<WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
1717
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1818
<UseIISExpress>true</UseIISExpress>

samples/wcfapp/WcfServiceWebApp/Web.config

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
99
The following attributes can be set on the <httpRuntime> tag.
1010
<system.Web>
11-
<httpRuntime targetFramework="4.7.2" />
11+
<httpRuntime targetFramework="4.8" />
1212
</system.Web>
1313
-->
1414
<system.web>
15-
<compilation debug="true" targetFramework="4.7.2"/>
16-
<httpRuntime targetFramework="4.7.2"/>
15+
<compilation debug="true" targetFramework="4.8"/>
16+
<httpRuntime targetFramework="4.8"/>
1717
</system.web>
1818
<system.serviceModel>
1919
<services>

0 commit comments

Comments
 (0)