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


NAPS2 build scripts are located in NAPS2\Setup\.

Project Structure


This is where the vast majority of NAPS2 functionality lives.


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


This is the C++ backend for the NAPS2.Scan.Wia.Native namespace, and acts as a replacement for the Microsoft-provided wiaaut.dll. It is not included in the normal build process; instead, the compiled 32-bit and 64-bit dlls are stored in the NAPS2\Setup\lib folder.


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.


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


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).


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


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).


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


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.


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).


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 as well as for ports 49319, 58985, 53893, 50086.

Back to Support