Using Local Mode Effectively

Visual Studio 6.0

Valerie Whitcomb
Microsoft Corporation

September 1998

Summary: Illustrates how to work in Microsoft Visual InterDev local mode to work on a Web project in isolation from the live Web application. Includes workflow suggestions for using local mode and requirements for your local machine. (6 printed pages)

Would you like to work on your Web pages in isolation from the live Web application other people are viewing on the Web server? Instead of maintaining separate test Web applications, you can use a project in local mode to work on the same Web application your team is working on or your users are using.

If you find yourself balking at the seeming complexity of "local mode," don't worry. Just remember that your Web project in Visual InterDev refers to two sets of Web files, and with local mode you can control when updates become "public."

The following tips for using local mode effectively also include a brief comparison of master and local mode. This article covers the following topics:

Useful Concepts for Understanding Project Modes

  • You work with one Web project that affects two sets of your Web files: one set called "local" and one set called "master." A Web project resides only on your workstation but points to two sets of your Web files: a set residing in a local directory and a set available in the master Web server directory.

    The terms "local" and "master" identify sets of files that make up your Web application as well as identify the system components that process the Web pages. The term "local" refers to the files or components that interact in isolation from the team server during local mode. They are located in the project directory. The term "master" refers to the files or components that are available on the team server to everyone for changing or viewing. For example, the team Web server is called the master Web server and it holds the master Web files.

    When you create a project, a local directory is created that holds the local versions of the Web files. Your developer workstation can have a local Web server installed that is not used by the team. In local mode, your local Web server provides all of the Web services for your Web application instead of the master Web server.

    While working in local mode, new files that you add to the project are added only to the local directory and are called personal files. Once you are ready to make them available on the master Web server, you will use the Add to Master Web command.

  • Master mode works like version 1.0. In version 1.0 of Visual InterDev, you work with and save changes to both sets of your Web files simultaneously. When you change a file and save it, the changed version is immediately available on the Web server. You know a project is in master mode by the project icon in the Project Explorer. The icon has a lightning bolt to signify the direct updates made to the master copies.

    Note   The option to work offline can be used with either project mode. However, when working offline you do not have any connection with the master server and, therefore, need local copies of everything you want to use to include your data. You can only refresh your view of the project with master files after going back online.
  • Local mode provides isolated development. In version 6.0, you have a choice of working as in version 1.0, called master mode, or working in isolation from the Web server using local mode. You know a project is in local mode by the project icon in the Project Explorer. This icon has no lightning bolt.

    When working in local mode, certain commands operate only on the files in the local directory. Their actions are reflected on the Web server only when you explicitly choose commands that interact with the Web server.

    For example, the Save command updates the local copy of the file, but in order to update the master copy, you need to use the command Release Working Copy (or Check In, if you are using Microsoft Visual SourceSafe®). Because you are saving only local copies, your changes do not affect the Web server version and the versions worked on by other team members. Likewise, your team members can put their projects in local mode and make changes without affecting others using the master Web server.

  • You need to know which Web server is your team server. Part of the complexity is dependent on the system you are using. For example, your team's Web server could be installed on one of the developer workstations or it could be installed on a server separate from the developer workstations. So the physical location of the Web server is not the key concept, but rather which Web server is the one your team considers to be the place to keep the Web application for testing or, in some cases, even for deployment. This is the Web server you specify when creating your project and is considered the master Web server.
  • The mode is a property of the project on each developer's workstation. Each developer creates a separate Web project in order to work on the team's Web application. Each developer can also set the mode he or she wants to use. The Web project provides a graphical representation of the Web application files in the Project Explorer. The Web project file (.vip) remains on the developer's local computer and is not part of the Web application files. This architecture allows developers to customize their view of the project and yet work on the same Web application as the entire team. When you deploy a Web application, the project file does not get copied with it, only the files containing your Web content and functionality.
    Note   Regardless of the mode that your project is using, you can also work offline. Offline for a Web project means that you work as if you have no connection to a network or to any Web server other than the local one.
  • The project manages the write-enabled and read-only states of the local files. The local files can be in either state for extended periods of time. You can open files in either state, but, of course, you can only modify files that are write-enabled. Files become write-enabled when they are checked out, if you are using source control, or when you use the Get Working Copy command. The Project Explorer shows write-enabled files by including a pencil next to the file name (or a check mark if you are using source control). When you check the file in or release the working copy, the state of the file changes to read-only and a lock appears in the Project Explorer.
    Note   If you open and save files without going through a project, the project is unable to manage the state of the file and may generate errors.
  • The modes do not replace source control. Although the project modes coordinate local and master copies of files, they do not protect and store your work as does Visual SourceSafe. However, the project does prevent unintentional overwriting. When you check in the file or release the working copy, the project detects if changes were made to the master copy while you were working on your local copy.

    If changes are saved to the master after you have gotten your working copy or checked out the file, you are provided options for handling the differences. One of the options is to merge the files. In most respects, this functionality works exactly the same as Visual SourceSafe because it uses the same interface. This merge capability is available whether or not you have Visual SourceSafe installed.

    While the project does warn you about overwriting current master copies and assists with resolving conflicts, it does not save a history or past versions. By itself a project does not have the source control database necessary to provide those features.

  • Some menu commands and tools work on the master copies even when your project is in local mode. All of the commands you need to work in isolation work only on the local copies of your files without affecting the master copies until you release them or check them in.

    However, some project-level commands, such as moving files and removing files, require immediate action on the master application as well. For example, if you try to move or delete a write-enabled copy, you are prompted to check it in or release it before doing the move or delete. Once you have released the copy, you can perform the action and the changes are made directly to the master set of Web files even though your project is in local mode. Likewise, if the automatic link-fixup property is set for your project, links in the master files may be updated when the links are fixed automatically. Also, the Web tools, Link View and Site Designer, work directly on the master copies regardless of your project mode.

  • When debugging a Web application, local mode is preferable. A project in local mode automatically uses only your local resources. Because you can readily control these resources, you can more seamlessly debug your Web application. Remote debugging is possible, but typically you aren't able to work as independently because a remote server is rarely dedicated for the use of a single person. For a detailed description of using debugging, see the documentation provided on the MSDN Library CD or check out the Visual InterDev Web site at for the latest debugging information.

Your Local Environment

If your master Web server is on a separate machine from your workstation, your workstation needs to have all of the services your Web application needs. So the question you need to consider is, "Which services or additional applications does my Web application require?"

Note   Your operating system affects which Web server is installed on your machine but does not affect how you work in local mode. If you are using Microsoft Windows® 95/98, the installation wizard installs Personal Web Server instead of Internet Information Server.

You do not need to use the following table if your workstation is also the team Web server, because it should already have the services you need for your project in local mode.

If your application uses You need
HTML and client script in HTM pages A Web browser and a local copy of the pages you are testing.
Links to other pages A local copy of the file, for destination pages within your current project. (For pages outside your project, the URL should resolve regardless of the project mode.)
Server script in ASP pages A Web server installed on your workstation.
COM objects The "Register on client" option enabled for the object in the project.
Data Nothing additional if your workstation is using the same local area network (LAN) as your database server. However, if you are working offline, using dial-up access, or working through a firewall, you need a local copy of your data and to set your connections to use it.
Microsoft Transaction Server Remote Machine Debugging, an application provided by the Microsoft BackOffice® Server wizard. Although the debugging components have already been set up by the VID client, this application registers some registry keys necessary to debug the Microsoft Transaction Server (MTS) processes.

Workflow Suggestions for Using Local Mode

The following major steps to work locally are shown to help you identify tasks you might want to do to avoid unexpected results. For detailed procedures for each major step, see the Visual InterDev documentation on the MSDN Library CD.

  1. Open or create a project for the Web application.
  2. Make sure your project is set to work in local mode.

    You can tell that your project is in local mode by the next to the project name in the Project Explorer. You can also look at the project's properties.

  3. Get write-enabled copies of the files you want to work on. You can use the Get Working Copy command on individual files or on an entire project. If your project is under source control, use the Check Out command.
  4. Get read-only copies of related files that you don't need to edit, but that are used by the pages you want to work on. You can use the Get Latest Version command on a project or individual files. This command is the same whether or not you are using source control.
    Note    Your data connections still work in local mode because the mode only affects the operations that maintain the local and master copies of files. Data connections are the same regardless of mode. You need a local copy of your data only if you work offline, are using dial-up access, or are working through a firewall. In those cases, you must have a local copy of the database and create a connection that uses the local data.
  5. Open the files, edit them, and save your changes. Because your project is in local mode, the changes are saved to your local Web application only; the master Web file does not change.
  6. If you have moved files or manually added links, you can do a quick visual check of the links using Link View.
  7. Preview the working version of the Web application in the Web browser. If you don't have a Web server on your developer workstation, the file is loaded with a file URL and server script won't work. If you do have a local Web server, your .asp files use the local Web server to process the server script.
  8. Update the master Web application. When you are satisfied with your working versions, you can release your local copy to update the master Web application.
  9. If you want to see to the master files, refresh the project. Any files added to the master Web application since you first began working will appear in the Project Explorer. Refreshing the project only updates your view of the files in the project. It doesn't overwrite the write-enabled local copies of the Web files.

For the latest information, visit the Microsoft Visual InterDev Web site at