First, you must clone the repository. Next decide whether you want to use a code editor like Visual Studio (recommended) or the command line.
- If you don't have Visual Studio 2017, you can install the free Visual Studio 2017 Community.
- Start Visual Studio.
- Select
File -> Open -> Project/Solution
and open theSamples.sln
solution file located in your cloned repository. - Compile using
Build -> Build Solution
. - To run models from a certain chapter, right-click on a correspondingly named project, select
Set as a StartUp Project
, then pressCtrl+F5
to start it.
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.
-
.NET Core 2.1 SDK to build and run projects targeting .NET Core.
-
(Optional) On Windows, the .NET framework developer pack. Provided visualizations are viewable only when targeting .NET Framework.
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.
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.