Bagikan melalui


How to: Publish Data Files in a ClickOnce Installer

ClickOnce installers automatically deploy data files if the file extension is .mdf, .ldf, or .xml. For all other data files, you must add the file to your project as a link and change the Copy to Output Directory property to Copy Always.

Applies to: The information in this topic applies to document-level projects and application-level projects for Microsoft Office 2010 and the 2007 Microsoft Office system. For more information, see Features Available by Office Application and Project Type.

The following procedure demonstrates how to add a data file in your project.

  1. In Solution Explorer, click the project name.

  2. On the Project menu, click Add Existing Item.

  3. Browse to the data file, and click the arrow next to the Add button.

  4. Click Add as Link.

  5. In Solution Explorer, click the data file.

  6. In the Properties window, set the Copy to Output Directory property to Copy always.

See Also

Tasks

How to: Publish an Office Solution by Using ClickOnce

How to: Install a ClickOnce Office Solution

How to: Publish a Document-Level Office Solution to a SharePoint Server

How to: Uninstall a ClickOnce Office Solution

Concepts

Publishing Office Solutions by Using ClickOnce

How to: Publish Template Solutions That Run Code on a Network

Customizing Office Solution Installation

Other Resources

Deploying Office Solutions