How to: Implement a Custom ClickOnce Deployment Server File Repository
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
To implement a custom ClickOnce deployment server file repository, you need to have a custom request handler running on the deployment Web server that will intercept inbound file requests for .application files, .manifest files, and .deploy files. That handler has to retrieve the files from whatever repository you want to use as an alternative to the usual ClickOnce file storage and have them stream back to the client computer as the response to the file requests. The handler also has to set the appropriate MIME content type header so 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 particular location or in a particular way. However, it makes more sense to factor out the retrieval logic from the handler into a provider that you can plug in multiple implementations of without having to update the handler.
The following steps are required for this procedure:
- Implement an HTTP handler that intercepts file requests for ClickOnce manifests and application files and retrieves them from a repository provider.
- Implement a repository provider that retrieves the files from wherever you need to store them.
- Configure the Web site in Internet Information Services (IIS) to route ClickOnce manifest file requests and application file requests to ASP.NET.
- Configure the ASP.NET application to use the handler for incoming ClickOnce manifest file requests and application file requests.
- Populate the repository with ClickOnce application files.
- Configure the handler to use the repository provider to retrieve the files.
- For information about how to accomplish this task, see Manual: Implement a Custom ClickOnce Deployment Server File Repository.