Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

How to: Move an Application to a Different Server

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.

When developing an application that will be deployed with ClickOnce, you should locally test ClickOnce deployment and functionality of your application on a regular basis to confirm that you are not making design or implementation choices that will not work as expected in the ClickOnce execution context.

At some point, you need to allow other audiences, such as Quality Assurance (QA) or end users, to gain access to your published application. In an enterprise environment, you may not have direct access to the QA servers or production servers to directly publish to them. Disciplined release procedures should prevent you from doing that anyway. When you publish from Visual Studio, the first thing Visual Studio does when you initiate publishing is rebuild the application. Each time you build an application, you end up with a set of executables that is different from those you used for previous tests, and your application could potentially not work correctly after it is rebuilt.

It is not sufficient to copy the manifests and application files to a new server to host the published application on a different server. One of the security protections includes embedding the deployment provider URL (labeled Install URL in Visual Studio and Start Location in Mage) in the deployment manifest. This ensures that if someone manages to obtain your published application files, the files cannot be installed on that person's server and then users allowed to launch the application from that server.

When you move your published application to a different location, you have to update the deployment provider URL in the deployment manifest to reflect the new location of the application. Because this changes the contents of the manifest and the manifest contains a digital signature, you must also re-sign the deployment manifest with a publisher certificate.

It is also unlikely in a large enterprise environment that you will be using your company's production publisher certificate when you are developing your application. To sign a ClickOnce deployment manifest, you need a .pfx file that contains both the public keys and private keys for the publisher certificate. In large organizations, access to the private keys for company certificates is usually closely controlled to avoid exploitation by former or malicious employees.

As a result, in addition to updating the deployment provider URL when you move the application to a production server, you will likely also have to re-sign the manifests. Both the application manifest and the deployment manifest must be signed with the same publisher certificate. The deployment manifest contains an application reference that includes the public key token of the application manifest. So, if you sign the application manifest with a new certificate, you also have to update the application reference in the deployment manifest in addition to updating the deployment provider URL and then sign the deployment manifest.

Ff649790.note(en-us,PandP.10).gifNote:
If an application has already been deployed to clients with one publisher certificate, you cannot publish an update to the application using a new publisher certificate. Updates must be signed with the same publisher certificate as the previous versions or the update will fail and the application will be disabled. This feature is designed to protect you from other people tampering with your application and signing it with their own certificate because they do not have access to yours.

To summarize, when you move an application to a new server, you will perform one of the following two procedures.

To move the application and sign with the same publisher certificate

  1. Copy the contents of the application's publish folder to a folder on the new deployment server. This can be done using any file copy mechanism.
  2. Open the deployment manifest and update the deployment provider URL to the URL that users will use to launch the application from the new server.
  3. Sign the deployment manifest with the same publisher certificate that was used to publish the version you are copying.

To move the application and sign with a different publisher certificate

  1. Copy the contents of the application's publish folder to a folder on the new deployment server. This can be done using any file copy mechanism.
  2. Open the application manifest and sign it with the new publisher certificate.
  3. Open the deployment manifest and update the deployment provider URL.
  4. Update the application reference within the deployment manifest to the newly-signed application manifest.
  5. Sign the deployment manifest with the new publisher certificate.

For detailed information about how to complete the preceding two procedures, see Automated: Move an Application to a Different Server or Manual: Move an Application to a Different Server.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.