Skip to content

Commit d003e51

Browse files
committed
Add .NET 4.7 sample
1 parent 38fca9f commit d003e51

File tree

5 files changed

+141
-0
lines changed

5 files changed

+141
-0
lines changed

Diff for: dotnetapp-4.7/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM microsoft/dotnet-framework:4.7
2+
WORKDIR /app
3+
COPY bin/Release/net47 .
4+
ENTRYPOINT ["dotnetapp-4.7.exe"]

Diff for: dotnetapp-4.7/Program.cs

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using System;
2+
using static System.Console;
3+
4+
class Program
5+
{
6+
static void Main(string[] args)
7+
{
8+
string message = "Dotnet-bot: Welcome to using .NET Framework!";
9+
10+
if (args.Length > 0)
11+
{
12+
message = string.Join(" ", args);
13+
}
14+
15+
WriteLine(GetBot(message));
16+
WriteLine();
17+
WriteLine("**Environment**");
18+
WriteLine($".NET Framework version: 4.7");
19+
WriteLine($"OS: {Environment.OSVersion}");
20+
}
21+
22+
public static string GetBot(string message)
23+
{
24+
string bot = $"\n {message}";
25+
bot += @"
26+
__________________
27+
\
28+
\
29+
....
30+
....'
31+
....
32+
..........
33+
.............'..'..
34+
................'..'.....
35+
.......'..........'..'..'....
36+
........'..........'..'..'.....
37+
.'....'..'..........'..'.......'.
38+
.'..................'... ......
39+
. ......'......... .....
40+
. ......
41+
.. . .. ......
42+
.... . .......
43+
...... ....... ............
44+
................ ......................
45+
........................'................
46+
......................'..'...... .......
47+
.........................'..'..... .......
48+
........ ..'.............'..'.... ..........
49+
..'..'... ...............'....... ..........
50+
...'...... ...... .......... ...... .......
51+
........... ....... ........ ......
52+
....... '...'.'. '.'.'.' ....
53+
....... .....'.. ..'.....
54+
.. .......... ..'........
55+
............ ..............
56+
............. '..............
57+
...........'.. .'.'............
58+
............... .'.'.............
59+
.............'.. ..'..'...........
60+
............... .'..............
61+
......... ..............
62+
.....
63+
64+
";
65+
return bot;
66+
}
67+
}

Diff for: dotnetapp-4.7/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
dotnet-framework:4.7 Sample
2+
====================
3+
4+
The dotnet-framework:4.7 sample demonstrates basic "hello world" usage of the .NET Framework 4.7. It shows you how you can build and deploy the app relying on the .NET Framework 4.7.
5+
6+
Script
7+
------
8+
9+
Follow these steps to try out this sample. To complete this sample you must have [Windows 10](https://www.microsoft.com/en-us/windows/get-windows-10) (or [Windows Server 2016](https://www.microsoft.com/en-us/cloud-platform/windows-server)), [Docker for Windows](https://docs.docker.com/docker-for-windows/), [Visual Studio](https://www.visualstudio.com/vs/), and [Git](https://git-scm.com/) installed.
10+
11+
> **Note:** You must use Windows Containers on [Docker for Windows](https://docs.docker.com/docker-for-windows/) to run this image. Be sure to check that you are properly switched to Windows Containers. Do this by opening the system tray up arrow and right clicking on the Docker whale icon for a popup menu. In the popup menu make sure you select 'Switch to Windows Containers'.
12+
13+
**Preparing your Environment**
14+
15+
1. Git clone this repository or otherwise copy this sample to your machine: `git clone https://github.com/dotnet/dotnet-framework-docker-samples/dotnetapp-4.7`
16+
2. Build the project locally
17+
- Build from [Visual Studio 2017](https://www.visualstudio.com/vs/) in release mode.
18+
- Build with the [.NET Core CLI](https://www.microsoft.com/net/download/core):
19+
- `dotnet restore`
20+
- `dotnet build -c release`
21+
22+
**Build and run Docker image**
23+
24+
Navigate to this sample on your machine at the command prompt. Make sure command prompt is open to the same folder that contains the Dockerfile.
25+
26+
1. Build the Docker image
27+
`docker build -t dotnet47-app .`
28+
2. Run the application in the container:
29+
`docker run dotnet47-app`

Diff for: dotnetapp-4.7/dotnetapp-4.7.csproj

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net47</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>

Diff for: dotnetapp-4.7/dotnetapp-4.7.sln

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.26510.0
4+
MinimumVisualStudioVersion = 15.0.26124.0
5+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetapp-4.7", "dotnetapp-4.7.csproj", "{259F2C52-7DEC-4614-B0C5-78E9EB133020}"
6+
EndProject
7+
Global
8+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9+
Debug|Any CPU = Debug|Any CPU
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|Any CPU = Release|Any CPU
13+
Release|x64 = Release|x64
14+
Release|x86 = Release|x86
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Debug|x64.ActiveCfg = Debug|Any CPU
20+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Debug|x64.Build.0 = Debug|Any CPU
21+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Debug|x86.ActiveCfg = Debug|Any CPU
22+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Debug|x86.Build.0 = Debug|Any CPU
23+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Release|Any CPU.ActiveCfg = Release|Any CPU
24+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Release|Any CPU.Build.0 = Release|Any CPU
25+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Release|x64.ActiveCfg = Release|Any CPU
26+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Release|x64.Build.0 = Release|Any CPU
27+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Release|x86.ActiveCfg = Release|Any CPU
28+
{259F2C52-7DEC-4614-B0C5-78E9EB133020}.Release|x86.Build.0 = Release|Any CPU
29+
EndGlobalSection
30+
GlobalSection(SolutionProperties) = preSolution
31+
HideSolutionNode = FALSE
32+
EndGlobalSection
33+
EndGlobal

0 commit comments

Comments
 (0)