Check in Files while offline
It is not possible to check in a file while offline, because the check-in command is not enabled because you are not connected to the network. This is deliberately set so that you can easily see which files are checked out offline when the item is brought back online.
Enter Online status
This is essentially the same as going into the offline state. To bring your solution and its projects online, on the File menu, click Source Control, and then click Change Source Control .... The dialog box displayed is the same as when you went offline. Select ' Connected ' to bring the solution and project online.
Synchronizing changes
To synchronize the changes you make while working offline with the solution and project files that are contained in the visual SourceSafe database, you need to check out each file that is checked out when you work offline from visual SourceSafe, and checkin a changed copy of the file into Visual SourceSafe.
When you go online, the following two dialog boxes are displayed for each file checked out offline:
Figure 10: Reconciling the Checked-out files in the disconnected state
First, click Check out (as shown in Figure 10).
Figure 11: Checking out a file from Visual SourceSafe
Select "Leave this file?" Prevents your modifications from being overwritten by the version contained in the Visual SourceSafe. Then, you need to check in your modified file.
Warning: If someone else checks in the file and then you check in the same file, the changes made by someone else will be overwritten.
Note: These dialogs are displayed only for files that you have checked out offline, but not for files that were checked out before you entered the offline state. Practice warnings, as indicated in the first dialog box, and you may lose data.
When you work offline, if you check out a file and another team member checks out, modifies, and checks in the same file, you must be very cautious, or your check-in will overwrite the changes to that team member. The safest option is to avoid offline file checkout. Always check out the files that you want to work with before you go offline. If you can't do this, or you forget to check out all the files you want to work on before you go offline, merge the files manually when you synchronize the changes.
If you check out a file while you are working offline, and another user checks out the same file, the following dialog box appears when you bring the solution and project online:
Figure 12: Warning displayed when trying to check out a checked-out file
Click OK. In Solution Explorer, a small warning symbol appears next to the file, indicating that the file still needs to be noted.
Finally, if you add a file to your project while you are offline, when you bring the project online, you simply check the new file in to Visual SourceSafe.
Tips and Tricks
URL consistent
It is best for all developers to use a unified virtual root directory, such as Http://localhost/projectName. Try to avoid using specific server names, as this may make it difficult for users to share project files. If you need to use a specific server name, define a new <configsections> in the Web.config file, and define the application's customizations with it. If you are using a Web reference, place the Web service locally and use Http://localhost/webServiceName as a Web reference, or set the Web reference URL behavior to dynamic. The dynamic URL behavior is described later.
Reference Path consistent
When you add a reference to a system-less assembly, the IDE copies the assembly locally to the project (for the Web application, the assembly is copied to the Bin directory). To control whether the set is replicated locally, right-click the assembly, and then click Propertities. For non-system assemblies, "Copy local" should be set to "True". This is the default value and is recommended for most cases.
When you add a reference, the IDE also updates the reference path within the user project file to indicate the actual location of the assembly. Right-click the item, and then click Propertities. Click Common Properties, and then click References Paths. In the dialog box (as shown in Figure 13), click Cancel.
Figure 13: Show Reference Path
Although the reference path appears as a property of the project, it is actually unique to the project, computer, and user that set the property. This means that if developer 1 adds a reference to the assembly and checks in the project file, when developer 2 gets the latest version of the project file, the assembly is displayed in Solution Explorer--but the build is likely to fail because developer 2 may not have the same reference path.
To avoid this problem, all developers of the team should use a unified reference path within the team. This allows other developers to do nothing with the solution or project file as long as the following conditions are met:
- The reference path has been set and only one set for each project task
- The referenced assembly already exists on the hard disk and is in the correct location
The method requires that you define a standard build output location and that all references refer to assemblies within that location. If the condition is too strict, you can include multiple paths separated by commas in the reference path.
Add Web Reference
This is also one of the improvements to Visual Studio. NET Beta 2 relative to Visual Studio. NET Beta 1.
In the same folder as your project, there is a Web References folder. When you add a Web reference, a new folder is created under the Web References folder. The new folder is named according to the server hosting the Web service and contains WSDL, DISCO, and the generated Web service client proxy. The folder name is also used as the namespace for the Web service client proxy.
When you add a Web reference, these folders and files are added to the Visual SourceSafe project. When you update a Web reference, the files are also checked out, updated, and checked in. (Right-click the Web Reference, and then click Update Web Referemce.) )
When you add a Web reference, the Web service URL is hard-coded within the Web service client proxy. However, you can change the behavior of the Web service client proxy so that it reads the Web service URL from the. config file. Right-click the Web reference, click Properties, and Change URL Behavior from Static to Dynamic.
Figure 14:web Reference Property
The following code will be added to the. config file:
Value= "Http://localhost/WebServiceTest/Service1.asmx"/> </appSettings></configuration>
The constructor for the Web service client proxy is also modified to read the Web service URL from the. config file.
One issue to note is that you cannot add two Web references to the same server that point to different Web services. This is because the IDE attempts to create another Web reference with the name of the folder that already exists. See above for instructions on how to represent Web references within a file system.
But that is just a small problem. Simply rename the folder to the name of the actual service, rather than leaving its name (and namespace name) as the name of the server hosting the Web service. Right-click the Web reference, click Propertities, and Change Folder Name.
Issues in Visual Studio. NET Beta 2
Project file Check out
The project file is checked out automatically when it needs to be changed. This usually happens when you add a file to a project or change a project's settings. However, the project file is often not checked in after modification. In some cases, unnecessary project file checkout behavior occurs during the build process and in the editing of the form. These are known errors that should be resolved in the final version.
The end result is that this can cause team developers to scramble project files. If you find that a team member conflicts when a project file is checked out, you may need to switch to a shared checkout.
Please note that the special in Solution Explorer
!The identity symbol indicates that you have exclusively checked out the project file.
Projects in multi-solution
Although Visual SourceSafe integration supports the use of projects for multiple solutions, there is still an error. With Visual Studio. NET Beta 2 o'clock, it is best to be as careful as possible and ensure that each project belongs to only one solution.
Work offline
There are many issues to be aware of when working offline. The main problem is that you need to cancel the warning dialog box so that you can successfully check out the file when you work offline. This and other issues have been described earlier.
Project is not in Visual SourceSafe
This can be a minor problem, but if your project is not within visual SourceSafe and the solution is within Visual SourceSafe, Solution Explorer will display the project and its files as checked out, even if they are not in visual Sour In Cesafe. You can think that checked out identifiers represent "local changes" or are not added to Visual SourceSafe. The check-in command adds a project file to the Visual SourceSafe.
Delete a reference
This may also be a minor problem, but if you delete a reference to a system assembly, the IDE will not update the reference path within the user project file. The actual location of the assembly remains in the reference path, even if the assembly is no longer referenced.
Generating Multiple Project Solutions
By default, each project should be generated to its own output directory. Typically, projects are generated to bin\debug or Bin\release subdirectories. Building multiple projects within a solution into the same directory is not supported.
For any references in the same solution (that is, to generate output from projects that are referenced by other projects within the same solution), "Copy local" should leave the default value TRUE. This applies both to assembly references and to references between projects.
Summarize
The team work feature in Visual Studio. NET Beta 2 is a significant improvement over Visual Studio. NET Beta 1. Now all the core programs are working, and most of them are running well. Although some minor errors still need to be addressed before publishing, the changes in Visual SourceSafe integration and the IDE bring an improved team development experience. It is now easier to share project files and source code files among developers, and it is easier to move applications from the development environment to test and product environments.