Build & Deployment

This section covers the steps involved in building and deploying the codebase.

Build Process

The project is built using the .NET SDK, which is configured in the generic-math.csproj file. The net6.0 target framework is used. The project uses NuGet packages for dependency management. The dependencies are specified in the generic-math.csproj file and are downloaded from the NuGet feed (https://api.nuget.org/v3/index.json). The following packages are used in this project:

  • System.Runtime.Experimental: Provides access to experimental runtime features.

The build process is managed by the following files:

  • obj/generic-math.csproj.nuget.g.props: This file contains properties that are used by the NuGet package manager during the build process.
  • obj/generic-math.csproj.nuget.g.targets: This file contains targets that are used by the NuGet package manager during the build process.
  • obj/project.assets.json: This file stores the dependencies and their metadata for the project.
  • obj/generic-math.csproj.nuget.dgspec.json: This file describes the dependency graph of the project.

The build process can be initiated using the following command:

dotnet build
          

Deployment Process

The deployment process involves packaging the application into a self-contained executable. The deployment process can be initiated using the following command:

dotnet publish -c Release
          

This will produce a folder containing the executable and all its dependencies.

Example Deployment Scenarios

Scenario 1: Deploying to a Linux Server

To deploy to a Linux server, copy the published folder to the server and execute the executable.

Scenario 2: Deploying to a Windows Server

To deploy to a Windows server, copy the published folder to the server and execute the executable.

Notes

The Program.cs file is the application’s entry point. The Blah() function is called when the application starts.


          ## Top-Level Directory Explanations
          
          <a class='local-link directory-link' data-ref="obj/" href="#obj/">obj/</a> - Temporary directory that stores compiled intermediate files during the build process.
          
          <a class='local-link directory-link' data-ref="obj/Debug/" href="#obj/Debug/">obj/Debug/</a> - Temporary directory for debug versions of the compiled intermediate files.
          
          <a class='local-link directory-link' data-ref="obj/Debug/net6.0/" href="#obj/Debug/net6.0/">obj/Debug/net6.0/</a> - Temporary directory for debug versions of the compiled intermediate files for .NET 6.0.