Skip to content

odaceo/lab-hello-world-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lab :: Hello World :: C# Application on Linux

License Build Status

Description

A simple C# application on Linux.

Prerequisites

Vagrant must be installed on your computer to mount the workbench for this project.

Open a Terminal and run the following commands:

vagrant up
vagrant ssh
cd /vagrant

Restoring dependencies

The restore command download dependencies specified in the .NET project.

dotnet restore

Compiling the application

The publish command produces binary files you can run without intalled .NET Core runtime. Use the following command for the current operating system and architecture:

dotnet publish -c release

Running the application

To launch the application use the following command:

./bin/release/netcoreapp1.1/ubuntu.16.04-x64/publish/hello Odaceo

What we learned

Creating a Console application

Use the following command to create a simple Hello World application:

dotnet new console --language C#

Compiling the application for another operating system

Reference the macOS Sierra runtime in the hello.csproj file:

    <RuntimeIdentifiers>ubuntu.16.04-x64;osx.10.12-x64</RuntimeIdentifiers>

And then use the following command for building macOS Sierra binaries:

dotnet publish -c release -r osx.10.12-x64

See the Self-contained deployments documentation for more details.

Reporting Issues

Issues can be reported at https://github.com/odaceo/lab-hello-world-csharp/issues

Source code

The source code is available at https://github.com/odaceo/lab-hello-world-csharp

License

All the source code is distributed under ASL 2.0.

Copyright

© 2015 Odaceo. All rights reserved.