Skip to content

Building from source

Michael Brown edited this page Mar 29, 2022 · 3 revisions

You may want to build and run your own Binner server from source code, and here are the basics on how to do it. Alternatively, you can simply download the pre-built version for your environment in the Releases section.

Requirements

  • Visual Studio (2022 preferred)
  • Node.js LTS version (current as of writing is 16.13.2) and is required to build the UI. Note that Visual Studio will optionally include Node.js if you choose the option when installing.

Tech Stack

The backend is built in C# .Net 6 (core) and the UI is javascript on the React framework.

Installing SSL Certificates

An embedded certificate is included with Binner as an alternative to using developer certificates. This aides with multi-platform installation. When building on Windows if you have not previously installed Binner you can run the following script in an elevated (Administrative) Powershell console to install the SSL certificate as trusted:

.\Binner\scripts\install-windows-certificate.ps1

Building

You can build and run in Visual Studio directly which will build both the backend server, the UI and install it's database when run for the first time. If you don't have the latest Visual Studio (2022 at the time of writing) you can use the (free community version should work fine).

Or you can build via command line using the following as long as you have the .net 6 SDK installed which includes the build tools (msbuild & dotnet command). The command line will allow you to create Debug builds as well as publish a release version.

To build a Debug build: dotnet build

The UI will build in visual studio automatically, however to start the UI manually:

cd Binner.Web\ClientApp
npm start

Publishing

The public build script used for publishing Releases can be seen on AppVeyor. You can see the latest build along with the script used to publish builds for all supported environments and includes building the windows installer.

To build and publish a deployable version for a specific environment:

Windows

dotnet publish ./Binner.sln -r win10-x64 -c Release --self-contained

Raspberry PI

dotnet publish ./Binner.sln -r linux-arm -c Release --self-contained

Ubuntu

dotnet publish ./Binner.sln -r ubuntu.14.04-x64 -c Release --self-contained

Linux

dotnet publish ./Binner.sln -r linux-x64 -c Release --self-contained

The published build will be located in Binner.Web/bin/Release/net6.0/win10-x64/publish (replace win10-x64 with the environment you built)

To build a deployable UI:

cd Binner.Web\ClientApp
npm run build

Install as a Service

To install as a Windows service simply run the exe with the install argument: ./Binner.Web.exe install and start the service manually or: ./Binner.Web.exe start