This documentation is archived and is not being maintained.

Offline Model for Office Solutions

There are three main options for enabling Visual Studio Tools for Office solutions to work when the computer is not connected to a network:

  • Deploying assemblies to each user.

  • Using the Internet Explorer cache.

  • Using IntelliMirror.

Each method has benefits and considerations that you should evaluate before you decide how to deploy your solution for offline use.

Deploying Assemblies to Each User

You can ensure that users have access to the solution assembly when offline by deploying the assembly to each user and installing it on the user's local computer. Users will have access to the assembly without having to synchronize or run the solution before going offline, but you should consider the following as well:

  • You must update every computer if a new version of the solution becomes available.

  • You must distribute the document (if applicable) and all assemblies to each computer, and use environment variables to ensure that the paths to the assemblies that are included in the application manifest are correct for each user's computer configuration. For more information, see How to: Deploy Solutions for Offline Use.

Using the Internet Explorer Cache

By default, Visual Studio Tools for Office solutions rely on the Internet Explorer cache to provide the offline experience. As a result, offline works according to the settings in the Internet Explorer Temporary Internet Files option. This includes temporary file deletion and the cache size quota.

Even when the assembly is unavailable, work can be done in Office documents and the changes saved back to the server later. If your solution requires the assembly to be available during offline use, consider the following:

  • The assembly must be stored on a Web server (HTTP or HTTPS location), and users must access the assembly at least once on the server to store the assembly in the cache. If this has not happened, the assembly load will fail and the managed code will not run.

  • Your project must include a configuration file. When the user's system is in offline mode, the common language runtime (CLR) will load an assembly from the Internet Explorer cache only if the assembly has a configuration file. For information about adding a configuration file to your project, see How to: Set Up Configuration Information for an Office Solution. The configuration file does not have to include information specific to your solution; you can add a default configuration file to your project if you do not need other functionality.

  • The name of the project is used for the assembly name. For the assembly to be accessible offline, the name must follow the HTTP protocol for characters that are supported as part of a URL.

  • The user's system must be explicitly placed in an offline mode. The Office application prompts the user to go offline if a network connection is not found, or the user can switch to offline mode using Internet Explorer's Work Offline command on the File menu. There is only one offline or online state for the computer; if the user switches the Office solution to offline then Internet Explorer and Outlook Express also work offline.

  • You should use the Publish Wizard to deploy your solution, particularly if the solution uses a deployment manifest. The Publish Wizard generates an external application manifest for you; that manifest contains an assembly path that is relative to the location of the deployment manifest, which makes offline scenarios more portable. If you change the external application manifest manually, you can also use an absolute path if you know it. The external application manifest specifies the assembly path in the codebase attribute of the installFrom element, which is a child of the dependency element. For more information about the installFrom element, see <installFrom> Element (Visual Studio Tools for Office Reference).

  • The server name in the assembly path in the application manifest must be all lowercase. Otherwise, the assembly will fail to load. For more information about the assembly path in the application manifest, see Application Manifests for Office Solutions.

  • The deployment manifest is checked each time an application-level add-in is loaded or a Microsoft Office Excel 2003 workbook or Microsoft Office Word 2003 document is opened. The current version of the assembly is downloaded if accessible.

  • Dependent assemblies must be present in the same directory as the main assembly.

  • You must explicitly load all referenced assemblies or they might not be available to the application while offline. Assemblies are not loaded into the Internet Explorer cache until they are used. If the solution did not call a referenced assembly while online, that referenced assembly is not available offline. To ensure that all assemblies are loaded into the cache when the solution is opened online, call Load on each referenced assembly in the solution in the Startup event handler.

  • Your code must take the offline state into account, for example making sure that the solution fails gracefully when trying to connect to databases or Web services while offline. Consider using data caching to maintain access to data in document-level customizations. For more information, see Caching Data.

  • Offline support might not be applicable for all solutions, so you might want to block a solution from running if there is no network connectivity.

If the system is in online mode and the assembly is unavailable when a document with managed code extensions is opened, Word and Excel will ask users if they would like to work offline and then attempt to load the assembly again. This is necessary because an explicit offline setting is required for Word or Excel to begin loading from the cache.

The application manifest must use an HTTP or HTTPS path for the assembly to be cached, and the assembly must be stored in an accessible Web location. For more information, see How to: Deploy Solutions for Offline Use.

For more information about the WinInet caching services, see Caching in the Microsoft Win32 Internet Functions documentation (

For more information, see Supporting Offline Browsing in Applications and Components (

Using IntelliMirror

IntelliMirror provides a mechanism to cache files that are shared using a UNC path, for example \\appserver\officeapps\expenses. The client caching mechanism was introduced in Microsoft Windows 2000 and is also available in Microsoft Windows XP. There are two ways to set up caching of a share:

  • If you have a server that is running Windows Server 2003, you can set up caching on the share so that every client automatically synchronizes with the server on connecting. Make sure that Offline Settings for the share are correctly set.

  • If you have an older Windows server or a non-Windows server then you must set the caching options on the client computer. Right-click the share in an explorer window and then click Make Available Offline in the shortcut menu. The Offline Files Wizard appears, which enables you to set the share to automatically synchronize files.

If you are using IntelliMirror to provide offline access to the latest assembly, consider:

  • Each user must synchronize before attempting to use the solution offline for the first time.

For more information about IntelliMirror, see the Microsoft Windows documentation.

See Also