How to: Include a Data File in a ClickOnce Application

Each ClickOnce application you install is assigned a data directory on the destination computer's local disk where the application can manage its own data. Data files can include files of any type: text files, XML files, or even Microsoft Access database (.mdb) files. The following procedures show you how to add a data file of any type into your ClickOnce application.

To include a data file by using Mage.exe

Add the data file to your application directory with the rest of your application's files.

Typically, your application directory will be a directory labeled with the deployment's current version—for example, v1.0.0.0.

Update your application manifest to list the data file.

mage -u v1.0.0.0\Application.manifest -FromDirectory v1.0.0.0

Performing this task re-creates the list of files in your application manifest and also automatically generates the hash signatures.

Open the application manifest in your preferred text or XML editor and find the file element for your recently added file.

If you added an XML file named Data.xml, the file will look similar to the following code example.