Color scheme: Dark
You are here: start » en » Documentation » Microsoft Access development tools » WKL Office SDK » WKL Office SDK reference » Project file reference: .acproj

Project file reference: .acproj

Signature

<Project>
  <PropertyGroup>
    <SchemaVersion>2</SchemaVersion>
    <AssemblyName>Customers</AssemblyName>
    <SourceRoot>source</SourceRoot>
    <BaseOutputPath>build</BaseOutputPath>
    <DeliveryRoot>delivery</DeliveryRoot>
    <Configurations>Customer</Configurations>
    <TargetAccess>any</TargetAccess>
    <Template>template</Template>
    <Accde>false</Accde>
    <AppMode></AppMode>
    <ConnectionProfile>DEV</ConnectionProfile>
    <Finish>FinishBuild</Finish>
    <Test>AllTests</Test>
    <ControlBlocks>control-blocks</ControlBlocks>
    <NeutralLanguage>sl</NeutralLanguage>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <Accde>true</Accde>
    <AppMode>Production</AppMode>
    <ConnectionProfile>PROD</ConnectionProfile>
  </PropertyGroup>
  <ItemGroup>
    <TablePolicy Include="tblCountries" Policy="SeedData" />
    <TablePolicy Include="tblCache" Policy="Ignore" />
  </ItemGroup>
</Project>

Summary

The project file names an Access application, where its sources are and how each build configuration builds it. It is MSBuild XML, so dotnet build reads the same file; every tool of the SDK reads it the same way.

Properties

ElementRequiredDefaultMeaning
SchemaVersionyes–2. A project of the DATEC Access SDK (schema 1) is refused with the hint to run migrate.
AssemblyNameyes–The name of the application: file name of the database and name of its VBA project; a VBA identifier.
SourceRootnosourceThe folder that holds the default locations of the sources (Source layout and formats), relative to the project file. A kind of source that source items put elsewhere doesn't use it.
BaseOutputPathnobuildThe folder of everything a build makes, relative to the project file, as BaseOutputPath in MSBuild: the database of a configuration in its output folder <BaseOutputPath>\<configuration>, a delivery in <BaseOutputPath>\Delivery. A folder inside the project folder (no ..); not versioned and never searched for sources.
DeliveryRootnodeliveryThe folder of the delivery settings, relative to the project file: delivery-settings.json, the delivery profiles, publisher.json and the starter projects. A folder inside the project folder (no ..); versioned with the sources.
ConfigurationsnononeBuild configurations besides Debug and Release, separated by ;, as in an SDK-style MSBuild project (Customer;Test). The SDK also knows a configuration that has a property group of its own (see below) without it being named here.
TargetAccessnoanyx86, x64 or any: the bitness of Access the application needs. check fails when the Access of the machine has another one.
TemplatenononeAn SDK project the application builds on: a folder with one .acproj, or the file; relative, absolute, or below a folder of the setting paths.templates (WKL_ACCESS_TEMPLATES, SDK settings). See Templates.
AccdenofalseMakes an ACCDE after the ACCDB. An ACCDE runs only in Access of the bitness that made it (Microsoft); build the ACCDE for 64-bit Office with 64-bit Access.
AppModenononeDevelopment, Administration or Production: the mode of the application model of WKL Forms Object Library that the ACCDE is made for. See AppMode.
ConnectionProfilenononeThe connection profile of the WKL Linked Tables Manager (DEV, TEST, PROD …) the build links tables with; none links no tables. The build connects to the data sources of the profile, so the build machine needs the drivers, network access and a login without a prompt; roundtrip does the same.
FinishnononeA public function of a standard module of the sources that the build runs at the end. See Finishing function.
TestnononeA public function of a standard module of the sources that returns the names of the test procedures wkl-office test runs. See Test function.
ControlBlocksnothe template's, then paths.controlBlocksThe folder of the control blocks of WKL Forms Object Library that replace placeholders in forms. The first that is set wins: this property, the template's, the environment variable WKL_ACCESS_CONTROL_BLOCKS, the setting paths.controlBlocks (SDK settings). A relative path resolves against the folder of the project file. On a developer PC, the folder control-blocks of the release package, for example %LOCALAPPDATA%\WKL\Access Components\<version>\control-blocks.
NeutralLanguagenononeThe language code of the neutral texts (source/texts/neutral.json), for example sl: the language the application is written in. That language needs no text file of its own, and keys without a text in it are not reported. See Source layout: application texts.
AccessDefaultFolder<Kind>nothe base folder of the kind's first item, otherwise the default locationThe folder that the export writes a new object of the kind to, relative to the project file, for example <AccessDefaultFolderForm>ui\pages</AccessDefaultFolderForm>. <Kind> is the item name without Access (see Source items); kinds that consist of a single file have no such property.

A PropertyGroup with Condition="'$(Configuration)' == '<name>'" overrides Accde, AppMode and ConnectionProfile for that configuration; the other properties are the same for all configurations (see Remarks).

Items

ItemMetadataMeaning
TablePolicy Include="<table>"PolicyWhat the build and the export do with the data of a local table (below). A table not named is SchemaOnly.
ProjectReference Include="<path>"–Another Access project whose database is referenced as a library. Read, but no build step uses it yet.
PolicyExport writesBuild loads
SchemaOnlythe schemathe empty table
SeedDataschema and dataschema and data (lookups, configuration)
FullDataschema and dataschema and data (small local databases kept with their data)
Generatedthe schemathe empty table; the finishing function fills it
Ignorenothingnothing (caches, per-user state)

Source items

By default, the sources are in fixed locations below SourceRoot (Source layout and formats). Source items put a kind of source somewhere else: each item includes the files that its Include attribute names, relative to the folder of the project file.

<ItemGroup>
  <AccessForm Include="ui\pages\*.form.txt;ui\dialogs\*.form.txt" Exclude="ui\pages\old\**" />
  <AccessTable Include="db\tables\*.table.json" />
  <AccessReferences Include="db\references.json" />
</ItemGroup>
ItemKindDefault location below SourceRoot
AccessQueryqueries .query.txtqueries/*.query.txt
AccessModulestandard modules .basmodules/*.bas
AccessClassclass modules .clsclasses/*.cls
AccessFormforms .form.txtforms/*.form.txt
AccessReportreports .report.txt (page settings .print.json next to them)reports/*.report.txt
AccessMacromacros .macro.txtmacros/*.macro.txt
AccessTabletable schemas .table.jsontables/*.table.json
AccessTableDatatable data .jsonl (with the folder <table>.files next to it)data/*.jsonl
AccessRelations, AccessReferences, AccessPropertiesone file eachrelations/relations.json, references.json, application/properties.json
AccessAppModel, AccessRibbonModel, AccessNavPaneModelone file eachapplication/app-model.json, ribbons/ribbon.json, navigation/navpane.json
AccessRibbon, AccessImage, AccessTheme, AccessTextsribbons, images, theme folders, text filesribbons/*.xml, resources/images/*, themes/*, texts/*.json

Rules:

  • Include and Exclude take files or patterns, several separated by ;, with the MSBuild wildcards: ? matches one character, * any number of characters within one file or folder name, and ** any number of folders. Case doesn't matter. The base folder of a pattern is the folder before its first wildcard: for ui\pages\*.form.txt, it's ui\pages.
  • An item includes only files with the file name extension of its kind: under AccessForm, ui\pages\* includes the .form.txt files there, not the page settings of a report next to them.
  • A kind without items stays in its default location. A project without source items is read exactly as before.
  • If one item names a file explicitly and a pattern of another item also matches it, the file belongs to the item that names it. Two patterns that match the same file are an error: name the file explicitly in one item, or narrow the patterns.
  • check and every command that reads the sources report these as errors:
    • an item that matches no file;
    • a file with the extension of an object, a table or table data that no item includes, below SourceRoot or below the base folder of a pattern (to leave a file out on purpose, exclude it with Exclude);
    • two files that hold the same object.
  • The folders build, obj, .git and .vs in the project folder and the folder of BaseOutputPath are never searched.
  • The export writes every object back to the file it came from. A new object goes to AccessDefaultFolder<Kind>; if that isn't set, to the base folder of the kind's first item; otherwise, to its default location.
  • Paths in messages (check, roundtrip) are relative to the folder of the project file.

Remarks

  • What is not in the file. References (in priority order) and database properties (typed) are sources of their own, source/references.json and source/application/properties.json, so an export never rewrites the file a person edits.
  • Other elements are left to MSBuild: the SDK reads only the properties and items above, so the file may hold properties of its own and the Import of the MSBuild targets.
  • Conditions. A property group of SDK properties takes only the form '$(Configuration)' == '<name>'; another condition is refused. In a configuration group the SDK takes Accde, AppMode and ConnectionProfile; another SDK property there (SchemaVersion, AssemblyName, SourceRoot, BaseOutputPath, DeliveryRoot, Configurations, TargetAccess, Template, Finish, Test, ControlBlocks, NeutralLanguage, AccessDefaultFolder<Kind>) is refused, and properties of your own are left to MSBuild. Item groups with SDK items take no condition.

AppMode

The application model of WKL Forms Object Library (application/app-model.json) wants other startup properties for each mode: development (an ACCDB), administration (an ACCDE in the full Access) and production (an ACCDE in the runtime) - for example no bypass key and no special keys in production. The application corrects them itself when it calls EnsureApplication at its start. With AppMode, the build writes them into the ACCDE right away, so the delivered file is right from its first opening, before any code runs. AppIcon is removed from the ACCDE because it names a file of the build machine; the application writes the icon of the user's machine at its first start. The ACCDB stays a development database. check refuses an unknown mode and warns when the sources hold no application model or the configuration makes no ACCDE.

Templates

The template's objects, tables (with their policies), relationships, references and properties join the application's. A source of the application replaces the template's of the same name; the application's references come first; a property of the application wins. Theme, models and the finishing function come from the template when the application has none. A template that names a template itself is refused. export writes nothing the template alone contributes; to change an object of the template for one application, copy its file into the application's sources.

To build on a template that several applications share, keep it out of the application's repository: set <Template> to the template's folder name and the environment variable WKL_ACCESS_TEMPLATES to the folder that holds it (several folders separated by ;). A new version of the template then arrives with the next build.

Finishing function

The build runs it with Application.Run after the models, before the last compile and the ACCDE, for steps the SDK does not know (filling Generated tables, for example). It returns "" or "OK" for success; any other text stops the build with that text. An error it does not handle opens the runtime error dialog of VBA, which the build cancels and reports. It may run for at most 5 minutes; then the hidden Access of the build is ended and the build fails. It should follow the VBA error skeleton of an automation helper: handle its errors and return a text instead of raising. check refuses a name that is no public function of a standard module.

Test function

wkl-office test calls it with Application.Run in the hidden Access of the run. It returns the names of the test procedures, public procedures (Sub or Function) of standard modules without arguments, as an array (Array("Orders_Create", "Orders_Delete")) or as one text with the names separated by commas. A project that names a test function gets the test module WklTest of the SDK in every build, also when its sources have none; a module WklTest in the sources is always replaced by the SDK's, and the next export writes the SDK's into the sources. check refuses a name that is no public function of a standard module. See Test an application.

Placeholders for WKL controls

A rectangle in a form whose Tag is wkl:<Kind> (wkl:Grid, wkl:ActionBar …) is replaced, when the form is loaded, by the control block <Kind>.control.txt, with the rectangle's name, position, size and anchors. The release package of WKL Forms Object Library ships the blocks in control-blocks. check names every placeholder whose block is missing. The export writes the form with the control, so its source no longer needs the placeholder.

Code example

A release configuration that makes a production ACCDE and links tables with the production profile:

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
  <Accde>true</Accde>
  <AppMode>Production</AppMode>
  <ConnectionProfile>PROD</ConnectionProfile>
</PropertyGroup>
wkl-office build Customers.acproj -c Release
en/wiki/msaccess/sdk/reference/project-file.txt · Last modified: by Wolfgang van der Stille