M-Files provides developers with a Visual Studio 2017/2019 template that can be used to rapidly develop Vault Application Framework Applications using C#.
Downloading the Template
The Vault Application Framework 2.2 template is part of the
M-Files Online Visual Studio template package, which can be downloaded from the Visual Studio Marketplace.
Different versions of the Vault Application Framework template are available in this package. You should use the latest one that is compatible with the version of M-Files that you are targeting. Older versions should only be used if targeting older installations.
Building your first application
In this example we will create a basic Vault Application Framework application and install it into the Sample Vault, running on the local machine.
If you do not have M-Files installed on the same machine as Visual Studio, then you can alter the PowerShell script or deploy the zip file manually. Debugging can be undertaken on remote applications by following these instructions.
Creating an application from the template
Creating a new Vault Application Framework application can be done from within Visual Studio by clicking
Project, then selecting
M-Files Vault Application 2.2 From the list of Visual C# templates:
An overview of the project contents
The default project contains a number of items:
appdef.xmlThe application manifest file, containing information such as the publisher details and the current version number.
Configuration.csThe configuration class used by the Vault Application Framework application.
install-application.ps1A PowerShell script used to deploy the installation package to the local M-Files server.
VaultApplication.csThe actual Vault Application Framework application.
packages.confThe packages configuration file details the Nuget packages that are required for the Vault Application Framework to run.
The default application
The template automatically creates a
VaultApplication class, which is the entry point to your application. This class derives from the VAF 2.2 base class and defines that the
Configuration class is used for configuration.
To customise this default application, check out our samples and libraries or other tutorials.
The PowerShell script
The PowerShell script has not changed in functionality from the VAF 2.1 version.
Building and deploying
Building and deploying has not changed from the VAF 2.1 version.
Debugging has not changed from the VAF 2.1 version.
Tips and tricks
Please also see the tips and tricks for the VAF 2.1 and VAF 2.0 versions, as they also apply here.
Nuget packages and versions
The Vault Application Framework 2.2 release requires Newtonsoft.Json (JSON.NET) version 10.0.3.