Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Added 3.5 and 4.6.2 Samples #1

Merged
merged 4 commits into from
Nov 5, 2016
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
24 changes: 22 additions & 2 deletions dotnetapp-3.5/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
dotnetapp-3.5 Sample
dotnet-framework:3.5 Sample
====================

The dotnetapp-3.5 sample demonstrates how you can build and run the dotnetapp sample using the [.NET Framework 3.5 Docker image](https://hub.docker.com/r/microsoft/dotnet-framework/).
The dotnet-framework:3.5 sample demonstrates basic "hello world" usage of .NET Framework 3.5. It shows you how you can build and deploy a project relying on .NET Framework 3.5 in Docker.

Script
------

Follow these steps to try out this sample. They assume that you already have [Git](https://git-scm.com/downloads) and [Docker](https://www.docker.com/products/docker) clients installed.

Since the .NET Framework only runs on Windows you must have Docker set to use Windows containers. You can find more information on that here.

**Preparing your Environment**

1. Git clone this repository or otherwise copy this sample to your machine: `git clone https://github.com/dotnet/dotnet-framework-docker-samples/dotnetapp-3.5`
2. Navigate to this sample on your machine at the command prompt or terminal. Make sure terminal is open to the same folder that contains the Dockerfile.

**Build and run Docker image**

1. Build the Docker image
`docker build -t my-dotnet35-app .`
2. Run the application in the container:
`docker run my-dotnet35-app`

22 changes: 22 additions & 0 deletions dotnetapp-3.5/dotnetapp-3.5.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetapp-3.5", "dotnetapp-3.5\dotnetapp-3.5.csproj", "{E00527DF-512D-47B6-B341-C090F0D01DA7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E00527DF-512D-47B6-B341-C090F0D01DA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E00527DF-512D-47B6-B341-C090F0D01DA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E00527DF-512D-47B6-B341-C090F0D01DA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E00527DF-512D-47B6-B341-C090F0D01DA7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions dotnetapp-3.5/dotnetapp-3.5/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>

<supportedRuntime version="v2.0.50727"/></startup>
</configuration>
4 changes: 4 additions & 0 deletions dotnetapp-3.5/dotnetapp-3.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM microsoft/dotnet-framework:3.5
WORKDIR /app
COPY bin/Release .
ENTRYPOINT ["MyDotNet35App.exe"]
69 changes: 69 additions & 0 deletions dotnetapp-3.5/dotnetapp-3.5/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System;
using static System.Console;

class Program
{
static void Main(string[] args)
{
string message = "Dotnet-bot: Welcome to using .NET Framework!";

if (args.Length > 0)
{
message = System.String.Join(" ", args);
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why System is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 907db09

}

Console.WriteLine(GetBot(message));
Console.WriteLine();
WriteLine("**Environment**");
WriteLine($".NET Framework version: {(Environment.Version.Major == 4 ? "4.6.2" : "3.5") } ");
WriteLine($"OS: {Environment.OSVersion}");
#if DEBUG
Console.ReadLine();
#endif
}

public static string GetBot(string message)
{
string bot = $"\n {message}";
bot += @"
__________________
\
\
....
....'
....
..........
.............'..'..
................'..'.....
.......'..........'..'..'....
........'..........'..'..'.....
.'....'..'..........'..'.......'.
.'..................'... ......
. ......'......... .....
. ......
.. . .. ......
.... . .......
...... ....... ............
................ ......................
........................'................
......................'..'...... .......
.........................'..'..... .......
........ ..'.............'..'.... ..........
..'..'... ...............'....... ..........
...'...... ...... .......... ...... .......
........... ....... ........ ......
....... '...'.'. '.'.'.' ....
....... .....'.. ..'.....
.. .......... ..'........
............ ..............
............. '..............
...........'.. .'.'............
............... .'.'.............
.............'.. ..'..'...........
............... .'..............
......... ..............
.....
";
return bot;
}
}
65 changes: 65 additions & 0 deletions dotnetapp-3.5/dotnetapp-3.5/dotnetapp-3.5.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E00527DF-512D-47B6-B341-C090F0D01DA7}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyDotNet35App</RootNamespace>
<AssemblyName>MyDotNet35App</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Dockerfile" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
25 changes: 22 additions & 3 deletions dotnetapp-4.6.2/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
dotnetapp-4.6.2 Sample
======================
dotnet-framework:4.6.2 Sample
====================

The dotnetapp-4.6.2 sample demonstrates how you can build and run the dotnetapp sample using the [.NET Framework 4.6.2 Docker image](https://hub.docker.com/r/microsoft/dotnet-framework/).
The dotnet-framework:4.6.2 sample demonstrates basic "hello world" usage of the .NET Framework 4.6.2. It shows you how you can build and deploy the app relying on the .NET Framework 4.6.2.

Script
------

Follow these steps to try out this sample. They assume that you already have [Git](https://git-scm.com/downloads) and [Docker](https://www.docker.com/products/docker) clients installed.

Since the .NET Framework only runs on Windows you must have Docker set to use Windows containers. You can find more information on that here.

**Preparing your Environment**

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.6.2`
2. Navigate to this sample on your machine at the command prompt or terminal. Make sure terminal is open to the same folder that contains the Dockerfile.

**Build and run Docker image**

1. Build the Docker image
`docker build -t my-dotnet46-app .`
2. Run the application in the container:
`docker run my-dotnet46-app`
22 changes: 22 additions & 0 deletions dotnetapp-4.6.2/dotnetapp-4.6.2.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetapp-4.6.2", "dotnetapp-4.6.2\dotnetapp-4.6.2.csproj", "{CDD30738-A6C7-4B6E-BD8D-EFECA803270E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CDD30738-A6C7-4B6E-BD8D-EFECA803270E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDD30738-A6C7-4B6E-BD8D-EFECA803270E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDD30738-A6C7-4B6E-BD8D-EFECA803270E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDD30738-A6C7-4B6E-BD8D-EFECA803270E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions dotnetapp-4.6.2/dotnetapp-4.6.2/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
4 changes: 4 additions & 0 deletions dotnetapp-4.6.2/dotnetapp-4.6.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM microsoft/dotnet-framework:4.6.2
WORKDIR /app
COPY bin/Release .
ENTRYPOINT ["MyDotNet46App.exe"]
70 changes: 70 additions & 0 deletions dotnetapp-4.6.2/dotnetapp-4.6.2/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using static System.Console;

class Program
{
static void Main(string[] args)
{
string message = "Dotnet-bot: Welcome to using .NET Framework!";

if (args.Length > 0)
{
message = String.Join(" ", args);
}

Console.WriteLine(GetBot(message));
Console.WriteLine();
WriteLine("**Environment**");
WriteLine($".NET Framework version: {(Environment.Version.Major == 4 ? "4.6.2" : "3.5") } ");
WriteLine($"OS: {Environment.OSVersion}");
#if DEBUG
Console.ReadLine();
#endif
}

public static string GetBot(string message)
{
string bot = $"\n {message}";
bot += @"
__________________
\
\
....
....'
....
..........
.............'..'..
................'..'.....
.......'..........'..'..'....
........'..........'..'..'.....
.'....'..'..........'..'.......'.
.'..................'... ......
. ......'......... .....
. ......
.. . .. ......
.... . .......
...... ....... ............
................ ......................
........................'................
......................'..'...... .......
.........................'..'..... .......
........ ..'.............'..'.... ..........
..'..'... ...............'....... ..........
...'...... ...... .......... ...... .......
........... ....... ........ ......
....... '...'.'. '.'.'.' ....
....... .....'.. ..'.....
.. .......... ..'........
............ ..............
............. '..............
...........'.. .'.'............
............... .'.'.............
.............'.. ..'..'...........
............... .'..............
......... ..............
.....

";
return bot;
}
}
Loading