This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
Added 3.5 and 4.6.2 Samples #1
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 907db09