Visual Studio .NET team development
table of Contents:
〇, Abstract First, Prepare before the development, create an empty SourceSafe database three, create a new project and add version control four, get several concepts of the project five, version control in SourceSafe, the management of the version control, summary
〇, summary
In the enterprise development environment, source code management occupies an important ring. This article will create a sourceManager, which is created by an instance, to tell how to use the Visual Studio.net development environment, with Visual Source Safe 6C and IIS, create a corporate team development environment.
First, prepare before the development
1. Install .NET Framework SDK, Visual Source Safe 6c on a machine equipped with Windows 2000 or Windows XP Professional or Windows XP Professional. (If the user operating system is Windows .NET Server, there is no need to install .NET Framework SDK, .NET Server comes with IIS 6 has completely contains support for .NET's support) These tools can be on the installation of Visual Studio.net. turn up.
2, a server that is specifically used to store the version control center database. The server does not need to install .NET Framework SDK and VS.NET, but you must have VSS 6C. We call this server to develop server Datacenter.
3, a primary domain controller, add the DataCenter server to this domain, and allocate domain accounts for each development user. Such all group members can access version control information by logging in to the Window NT domain.
Note: Visual Source Safe 6 with Visual Studio 6 does not support some file formats of .NET. If you have VSS 6 installed, you also need to install the VSS 6C, otherwise you will have an error in the VS.NET environment.
Second, create an empty SourceSafe database
Before you start working, you need to create an empty SourceSafe database to save the source code control data and assign an access account for the team developers. Create a new Source Safe database on the DataCenter server. Proceed as follows:
1. Start the "Start" - "Program" - SourceSafe 6.0 Admin under "Microsoft Visual SourceSafe" menu. If you are the first time you install the VSS 6C, the admin account of the Common database is empty. As shown in the figure:
Figure 1 VSS login window
2. In the Visual SourceSafe Administrator window, you can see the Source Safe default two users Admin and Guest. If you don't plan to use the default CommON database, build a project database belonging to your own project. Select menu "Tools" - "Create Database", as shown in Figure 2:
Figure 2 VSS management window
3. Select the location where the new data inventory placed in the pop-up dialog box. Here we choose: C: / sourceManager /. After clicking OK, you have created a database.
4. Select "Users" - "Open SourceSafe Database ...", use the Browser button, select the SourceManager Database C: /SourceManager/srcsafe.ini you created just now.
5. Use the "Users" - "Change Password" command to change the password of the admin account. Create a SourceSafe account for the project team member using the "User" command. 6, set the C: / sourceManager directory to sharing. Shared permissions The default is EVERYOE complete control. If you want to open only the members of the project team, do not want others to operate the database file (Note: People without the SourceManager account cannot access the contents in the SourceSafe, but if he has permission, you can delete or modify the data in the database), please The Everyone group is removed from the permission group and selects a domain account or computer that can access the directory from the domain directory.
7. Here, an empty project database is completed.
Third, new projects and add version control
Here's a Windows application and a web project on a computer with VS.NET and add it to the SouceManager database built above.
1, start the vs.net.
2. Use the "File" - "New" - "Blank Solution" command, to create a new solution in D: / down SourceManager. VS.NET will automatically create a SourceManager directory in D: /, with a solution file SourceManager.sln file in this directory.
3, use the "File" - "New" - "Project" command, select "Visual C # item" in the project type, select "Window Application" in "Template". Project Name MYWINDOWAPP. And select the Add to Solutions option. determine.
Figure 3 New Windows Application Project Window
4. Use the "File" - "New" - "Project" command, select "Visual C # item" in the project type, select "ASP.NET Web Application" in Modules. Fill in http: // localhost / mywebapp in the Location box. And select the Add to Solutions option. determine.
Figure 4 New Web Application Window
This creates a Window application and a web application in the solution. Here is how to add the entire solution to the source code version control.
5. Add a Label control in the designer of WebFrom1 and Form1, keeping its properties constant. We will see this control in the program user interface obtained from another host.
6. Use the "File" - "Source Management" - "Put the Solution to the Source Management" command.
Figure 5 Source Code Management Menu
7. In the pop-up Visual SourceSafe Login login window, click the "Browser" button, pop up the Database dialog box, click the "Browser" button of the dialog box, pop up the following dialog box, enter // datacenter / sourceManager / SourceManager / Srcsafe.ini. After confirming, enter the SourceSafe account and password allocated above.
Figure 6 Opens the VSS Database dialog
8, first pop up a prompt window to save the solution, let you choose the project name that will be saved to the SourceSafe, the default is the same as the name of the solution. Click OK to get a prompt that the project does not exist in the database, click "Yes" to create the project.
Figure 7 Creating a Project Dialog in VSS
9, next will let you choose the save location of the web application. As shown below. Since web applications are usually saved in the local IIS root directory. Other items in the solution are not in the same directory, so you need to create a project separately for the web application in SourceSafe. Click the "OK" button in this window to accept the default item name MyWebApp. Figure 8 Create a web project dialog in VSS
10. Here, we have added the entire solution to the SourceSafe, including a Windows application and a web application. In the Solution Explorer view, there is a lock next to the program that is added to the source code control (shown in Figure Nine), indicating that the document has been checked, and cannot be edited.
Figure Nine Solution Explorer
11, through the menu "file" - "Source Code Management" - "Microsoft Visual SourceSafe", open SourceSafe, you can see that two items have been added in SourceSafe. As shown in Figure 10:
Figure 10 VSS browser
Fourth, get the project in SourceSafe
The following steps will be described on how to get the source code from the SourceSafe on another host.
1. Open the Visual Studio.NET development environment on another host. Use the menu command "File" - "Source Management" - "Open from Source Code". Repeat the seventh operation in the third step and select the location of the SourceSafe database.
2, pop up the "CREATE LOCAL POJECT from Source" window, fill in the local path you want to save in the "Create A New Project In The" input box, here we choose "C: / MyProject". Select the SourceManager project in SourceSafe Project To, click the OK button. If the directory C: / myProject does not exist, ask if it is created, select "Yes All".
Figure 11 From SourceSafe Get Project Dialog
3, then pop up the dialog box to save the WEB application work, enter the web folder you want to save the web application in the Work Copy Location Enter box, or accept the default settings. Click the "OK" button to accept the default settings.
Figure 12 Gets the Web Project Dialog from SourceSafe
4. Through the above steps, we have successfully obtained projects saved in SourceSafe on another development host. If there is a new developer to join, you can repeat these four steps.
V. Several concepts of version control
In the context menu or "file" of the Visual Studio.NET Development Environment "Solution Explorer" - there is a command related to the file operation, as shown in Figure 13:
1, "Check Out": When you need to edit a file, you must "check out", SourceSafe will log this file has been migrated out by a user and make sure other users cannot edit the same file. For files, this option is only available after the file is checked.
2, "Check IN): After completing the editing of the file, it is best to" check "to enable other users to check out or get the latest version. For files, this option is only after the file is checked out.
3, "Get the latest version": Get the latest version of the specified file or item from the SourceSafe database, but no need to check out the file.
4, "Cancel Check": Do not save the checkout in the SourceSafe database, so that the local file is restored to the state before the modification, and the file is checked in. There is only this option only after the file or file is checked out. 5, "History": View the history of the file modification. The SourceSafe database will automatically save the file content before and after each "check". If you need to view a history.
6, "Version Compare": Compare the difference between the current version and the historical version, SourceSafe will display the difference between the two versions in the form of a control. As shown in Figure 14:
Figure 14
7. "Roll Back": There is a roll back command in the History Version Display dialog box to recover files to historical versions. When the file edits an error, use this command when you want a file to return to a point of history. There are other commands in the historical version of the display dialog, which will not be detailed here, readers should study slowly.
8, Visual Studio.NET: Options for Version Control: In the Tools - Options command dialog box, select the "Source Management" on the left to display the following dialog. The reader can set the SourceSafe option according to the situation of the project.
Figure 15 Visual Studio.NET in Visual Studio.net options related to version control
9, other SourceSafe operation: The reader can enter "Visual SourceSafe Explorer" from the "File" - "Source Code Management" menu, "Visual SourceSafe Explorer", most of which are basically the same as Visual Studio.net, here No longer cumbersome.
Six, version control project management
Some permission management and file mappings related to version control are described below. First open "Start" on the DataCenter server - "Microsoft Visual SourceSafe" - "Visual Source Safe 6.0 Admin". Select the SourceManager database and fill in the password of the Admin account. Go to the SourceSafe Administrator window. It has the following menus.
1. Under the UserS menu is about the user's operation, in addition to the addition of the user "Add User" above, modify the password "Change Password", there is also a user "delete user", edit the user "Edit User" command. The "Open SourceSafe Database" command is used to change the current SourceSafe database.
2. The Options dialog box under the Tools menu includes some project settings. The following is a brief description of the main options:
(1) Allow Multiple Checkouts in General page, if this is selected, allow multiple users to check out files at the same time. It is not allowed by default.
(2) The "Enable Project Security" checkbox in the Project Security page indicates whether the item is allowed to use security. The default is not allowed. Only after this option is selected, "Right Assignments for User", "Right Assignments for User" and "Copy User Rights" under Tools are available. Here we choose it.
(3) SHADOW Folders Pages for settings projects on the server. The project saves all the versions of the file in the file in the SourceSafe form in the file. To create a directory on the server, map the project file to this directory and use the command. Select the SourceManager project in SourceSafe in "SET SHADOW Folder for Project", select the directory to map to the item in "Set Shadow Folder To", such as C: / SourceManager_Shadow. (4) Web Projects Use to set mappings on the server on the server. Select the MyWebApp project in SourceSafe in this Project Represents A Web Site, fill in "http: // localhost" in the URL, the local web server (you can also fill in other servers). Fill in the virtual directory you want to map in Virtual Tools, fill in the Deployment Directory in Deployments Path, which will become the map directory specified in the IIS.
3, "Rights By Project" manages SourceSafe's permissions in the "Rights By Project" under the Tools menu, as shown. There are four kinds of user privileges, corresponding to: R (READ), C (Check Out / Check IN), D (DESTROY) in Rights. Select a project in the "Project" box on the left and select the appropriate user in the right, use the following check box to assign the corresponding permissions. "Rights Assignments for User" under the Tools menu is used to assign permissions to the selected user, the operation results are the same as the above command.
Figure 19 VSS project authority management
4, "Archive Projects" under Archive menu is used to package the specified item into * .ssa (SourceSafe Archive) file and migrate to other hosts, recover the file to other hosts using Archive's "RESTORE Projects" command. These two commands are used for the migration of the project.
to sum up
Using the SourceSafe with the vs.net development environment, you can provide a complete source code management solution for the team. Through source code management, you can record the process development process, restore files to a point during the project, and no need to save too much old document backup in the development environment.