How to: Implement a Custom ClickOnce Deployment Server File Repository

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
To create client business applications using current Microsoft technologies, see patterns & practices' Prism.

To implement a custom ClickOnce deployment server file repository, you must have a custom request handler running on the deployment Web server to intercept inbound file requests for .application files, .manifest files, and .deploy files. The handler retrieves the files from whatever repository you want to use as an alternative to the usual ClickOnce file storage, and then has them streamed back to the client computer as the response to the file request. In addition, the handler must set the appropriate MIME content type header so that the responses are properly handled by the ClickOnce runtime on the client computer.

You could write a handler that is hard-coded to retrieve the ClickOnce files from a specific location or in a specific way. However, it makes more sense to factor out the retrieval logic from the handler into a provider that you can plug into multiple implementations without having to update the handler.

The following steps are required for this procedure:

  1. Implement an HTTP handler that intercepts file requests for ClickOnce manifests and application files, and then retrieves them from a repository provider.
  2. Implement a repository provider that retrieves the files from wherever you need to store them.
  3. Configure the Web site in Internet Information Services (IIS) to route ClickOnce manifest file requests and application file requests to ASP.NET.
  4. Configure the ASP.NET application to use the handler for incoming ClickOnce manifest file requests and application file requests.
  5. Populate the repository with ClickOnce application files.
  6. Configure the handler to use the repository provider to retrieve the files.

For information about how to complete these steps, see Implementing a Custom ClickOnce Deployment Server File Repository.