How to: Change the Location of Document-Level Customizations (2003 System)
Applies to |
---|
The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office. Project type
Microsoft Office version
For more information, see Features Available by Application and Project Type. |
When you change the location of a deployed document-level solution, you redeploy it. For example, a developer might publish a solution to a testing server, and the IT department then redeploys the solution to a production server after approval. For Visual Studio Tools for Office solutions to continue to work, the application and deployment manifests must be updated with the new path to the solution files.
There are two types of redeployment scenarios for Word and Excel solutions:
Editing the application manifest in the document directly, using code.
This scenario is useful in these circumstances:
Before the solution is deployed to end users.
When the old server is suddenly taken out of service and end users cannot access the files on the old server.
When few end users are using the solution and it is easy to write a script to update each user's document.
Editing the manifest files on the server without using code to update the application manifest in the document.
This scenario is useful in these circumstances:
After the solution is deployed to end users.
When the old server is still available to all end users.
When many end users are using the solution, and it is difficult to run scripts on each user's document.
Note
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.
Editing the Application Manifest Using Code
To redeploy using code to edit the application manifest
Use the Publish Wizard to publish the solution to the testing server. For more information, see How to: Deploy Solution Files Using the Publish Wizard (2003 System).
The Publish Wizard copies the document and assemblies to the server, and creates the application and deployment manifests.
Copy the application manifest, the assemblies, and the deployment manifest to the new location.
There are now two sets of files, one on the old server and one on the new server.
Edit the new application manifest so that it points to the new deployment manifest and the new assemblies. For more information, see Application Manifests for Office Solutions (2003 System).
Increase the version of the application manifest.
Edit the new deployment manifest so that it points to the new application manifest. For more information, see Deployment Manifests for Office Solutions (2003 System).
Increase the version of the new deployment manifest.
Update the application manifest that is embedded in the document to point to the new deployment manifest location. For more information, see How to: Change the Path to the Deployment Manifest Programmatically (2003 System).
Note
Visual Studio Tools for Office includes a sample that demonstrates how to create a tool that you can use to edit the embedded application manifest. For more information, see ServerDocument Sample.
Editing the Manifests without Code
To redeploy by editing the files on the server
Use the Publish Wizard to publish the solution to the testing server. For more information, see How to: Deploy Solution Files Using the Publish Wizard (2003 System).
The Publish Wizard copies the document and assemblies to the server, and creates the application and deployment manifests.
Copy the application manifest, the assemblies, and the deployment manifest to the new location.
There are now two sets of files: one on the old server and one on the new server.
Edit the new application manifest so that it points to the new deployment manifest and the new assemblies. For more information, see Application Manifests for Office Solutions (2003 System).
Increase the version of the application manifest.
Edit the new deployment manifest so that it points to the new application manifest. For more information, see Deployment Manifests for Office Solutions (2003 System).
Increase the version of the new deployment manifest.
Edit the old deployment manifest so that it points to the new application manifest.
Increase the version of the old deployment manifest.
The next time an end user opens your solution document, the document will check the old deployment manifest and be redirected to the new application manifest. The document will download the new application manifest that contains pointers to the new assemblies and deployment manifest, and will use the files in the new locations.
See Also
Tasks
How to: Change the Location of Application-Level Add-ins (2003 System)
How to: Update Application Manifest Assembly Paths Programmatically (2003 System)
How to: Change the Path to the Deployment Manifest Programmatically (2003 System)
How to: Remove Managed Code Extensions from Documents (2003 System)
How to: Deploy Solution Files Using the Publish Wizard (2003 System)
How to: Deploy Solution Files Manually (2003 System)