Developer Onboarding

Back to Support

This page provides documentation for anyone working with the NAPS2 source code.

Development Environment and Compiling

You can open the NAPS2 solution with Visual Studio 2017 Community.

Build Configurations

Scripts

NAPS2 build scripts are located in NAPS2\Setup\.

Project Structure

NAPS2.Core

This is where the vast majority of NAPS2 functionality lives.

NAPS2.DI

This is the composition root for dependency injection (DI). It includes dependencies on Ninject (the DI container) and NLog (the logging framework).

NAPS2

This builds NAPS2.exe and passes control to NAPS2.DI.EntryPoints.WinFormsEntryPoint. The Setup subfolder also contains configuration for the EXE installer and other installation dependencies.

NAPS2.Console

This builds NAPS2.Console.exe and passes control to NAPS2.DI.EntryPoints.ConsoleEntryPoint.

NAPS2.Worker

This builds NAPS2.Worker.exe and passes control to NAPS2.DI.EntryPoints.WorkerEntryPoint. The worker is used to interact with 32-bit drivers (on 64-bit systems) and to render thumbnails (to avoid process-wide GDI+ locks).

NAPS2.Portable

This builds the NAPS2.Portable.exe launcher which is used in the portable builds of NAPS2. It launches NAPS2.exe in the App subfolder.

NAPS2.Setup

This WIX (Windows Installer XML Toolset) project contains configuration for the MSI installer. Note that EXE configuration and other installation dependencies are stored in the NAPS2 project under Setup (so they are accessible even without WIX installed).

NAPS2.Localization

Development-time tools for localization. Used by the Update-Templates.ps1 and Update-Resources.ps1 scripts.

NAPS2.Tests

This contains a small number of functional unit tests.

Oauth2 Client Credentials

Gmail and Outlook Web Access integration (for the "Email PDF" button) require client credentials to be set up for each service. If you want to include support in a custom build you will need to get your own set of credentials.

Google

Building NAPS2.Core generates a placeholder file NAPS2.Core\google.credentials.json. Replace it with the file you get from the Google Api Console (help).

Microsoft

Building NAPS2.Core generates a placeholder file NAPS2.Core\microsoft.credentials.json. Edit it and set the values from the Microsoft Application Portal (generate a password for client_secret).

You will also need to set up web redirect URIs to http://127.0.0.1:50320/ as well as for ports 49319, 58985, 53893, 50086.

Back to Support