Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 2 KB

BUILDING.md

File metadata and controls

48 lines (32 loc) · 2 KB

Building Sample Code

First, you must clone the repository. Next decide whether you want to use a code editor like Visual Studio (recommended) or the command line.

Building with Visual Studio 2017

  1. If you don't have Visual Studio 2017, you can install the free Visual Studio 2017 Community.
  2. Start Visual Studio.
  3. Select File -> Open -> Project/Solution and open the Samples.sln solution file located in your cloned repository.
  4. Compile using Build -> Build Solution.
  5. To run models from a certain chapter, right-click on a correspondingly named project, select Set as a StartUp Project, then press Ctrl+F5 to start it.

Building from the command line

Provided sample code runs, albeit without visualizing results, on .NET Core 2.1. You can build and run it using the command line as follows.

Prerequisites

Build

Navigate to the directory with the project you want to build and run

dotnet build -f netcoreapp2.1

The -f netcoreapp2.1 sets the target framework to .NET Core 2.1. By default all the projects target both .NET Core 2.1 and .NET Framework 4.6.1, which results in error on systems where the latter is not present.

Run

Either navigate to the directory with the project and run

dotnet run -f netcoreapp2.1 ./output

Or build the project, navigate to the directory with the binaries and run

dotnet project.dll ./output

Here project.dll should be replaced with the name of actual executable; ./output is the folder where the output produced by the program should be stored.