During this time, I worked on a. Net project and a project development team in the company. The development environment was vs.net, and the language was C #. Three people developed the project collaboratively. Since it is collaborative development, we need to find a source code control software for source code management and version control in development. The first thing we think of is clearcase, which is well-known and never used. Who knows this is really complicated? First, we need to install Active Directory on window2000 (it has been around for a whole day), and then the license problem. It is a tough task to install it, it can run. A look at so many program items, so many documents, a word: dizzy, what things ah, so complicated, not let people live. Since then, no one has mentioned clearcase, and they all think they are mentally retarded. The next choice is VSS. Compared with clearcase, VSS is really much more cute and small. Although it is not powerful with clearcase, it is enough for a general project that is not very large.
The Window application project is very simple, and there is no problem in the use process. Some problems occur in the Web application project, mainly because it is easy to make mistakes in some aspects during configuration, this section describes the VSS management of web applications.
The first problem is the version of VSS. in Visual Studio 6, VSS is version 6.0 ,. net cannot use this version. It must use vss6.0c, which is an improved version of 6.0. However, vss6.0c is not found in the seven discs of the vs.net Chinese Enterprise Architecture version. It is said that vss6.0c is available in the English version, I did not know the English version, but I found a vss6.0c on the Internet.
The installation is relatively simple. Now vss6.0c is installed on the server. After installation, there is a netsetup under the server directory c:/program files/Microsoft Visual Studio/common/VSS. EXE file, share this directory, and the client will execute this netsetup..
1. Create a source code management database
On the server side, you must first create a source code management database to store the server version of the shared files of your development team.
(1) create a shared network folder for the source code management database
On the Source Code Management Server, open windows Resource Manager and create a folder named test.
Right-click "test" and click "properties ".
In the "test properties" dialog box, click the "share" tab, and then click "share this folder ".
Now you can create a source code management database in the shared test.
(2) create a source code management database
On the server, click the start button, point to program, point to Microsoft Visual sourcesafe, and then click visual sourcesafe 6.0 admin ".
In the Tools menu of the visual sourcesafe administrator dialog box, click Create Database ".
In the "Create new VSS database in" box, find the "test" directory created above.
The source code management database of Visual Studio. NET has been set successfully.
Then add the user, that is, all the developers of the development team will assign an account to open the database for identity authentication.
2. Create a web application project
For example, if your web application is to be created in D:/Web, set up a Web in IIS to point to this directory, and specify port 90 to the Web, the URL of your web application is: http: // localhost: 90 /.
Well, this web is the initial location of your project.
Select Web Access Method
Select the Web access method first, and select the file sharing method. This method can fully utilize all the features of VSS source code management, which is better than the FrontPage method.
Open vs.net in tools/options ).
In the Options dialog box, click the projects folder, and then click Web Settings ).
Under preferred access method, click File Share ).
Now we need to create a vs.net web project on this web
File -- New -- Project, select Visual C # project on the left, and ASP. netweb application on the right. Point to your web URL at the location: http: // localhost: 90/. This will create a web application on your web
3. Add a web project to source code management
In Solution Explorer, right-click solution node and click Add solution to source control (add solution to source code management ).
Provide the database location according to the requirements of the source code management provider (which database do you want to add this web application to) and user login information. We add this web project to the database created above.
After selecting the database, you will be prompted about the storage structure of the web project in the database. First, you will be prompted about the storage location of the solution in the database (the solution is a higher level unit than the project, A solution can contain multiple projects. any project in. NET must be included in a solution. If no solution is specified, you will be assigned a solution with the same name as this project, such as this project, the project name is loaclhost, and vs.net automatically adds a solution named localhost). Here we create a directory named test_solution to store the solution, enter test_solution in the project, and press the create button, A test_solution directory is created under the root directory of the database.
In the root solution directory, type the name of the project folder, which contains the master copy of the web project file.
OK, your web is added to the VSS database test.
4. Once your web project enters the VSS database, the original http: // localhost: 90/web is no longer important. You can discard it, because all the information is in the database, all team members will open this project in the future to get a working copy in this database and then work on their local copies, the master copy is on the server. The team members only need to obtain data from the database for the first time and create a local working copy. Later, they only need to open the project locally with the general web project. The work copy interacts with the master copy by checking in and checking out.
5. Create a working copy
When a web project enters the VSS database, it is under VSS management. All members of the development team must obtain a local working copy of the master copy of the web project from this VSS database.
Make sure that your machine has IIS installed, because you need IIS support to create a Web working copy locally. This working copy will be created on your machine as a local web, to provide you with the ability to develop and debug this web Project on your own machine.
Select a Web Access Method
Select the file sharing method as described earlier.
On the File menu, click source control, and then click open from source control ). You will be prompted to enter the corresponding source code management database. We will find the test database created on the server and press the Browse button, the "Open sourcesafe Database" dialog box displays the VSS database that your local VSS knows. The test database is not listed here. Click "Browse, go to the shared test directory that we used to create the test database on the server and select srcsafe under this directory. INI file, open, give this database name "test", so that the test database containing our web project is introduced into the local VSS, open this database.
After you open the database, the system will allow you to select the path where the WEB Project solution is stored on your local machine.
Note: The storage location of the solution is selected here. We have discussed the solution in the previous section. You can store the solution on your own, after a work copy is created, it will work normally when you open your work copy from this solution.
OK. Next, select the local URL of the working copy. Generally, select a sub-directory under your local default web. For example, in this project, place the working copy in: http: // localhost/test
Visual sourcesafe application code
Sourcesafe source code control and Visual Studio. net is tightly integrated. the operations performed by end users in IDE will affect all Working Group members as long as they modify the solution, project, and text or binary files in the directory, the following lists the rules that all members should follow to ensure work efficiency and safety.
Preparations for source code control projects
Visual Studio.. Net project needs to use ide To build the initial project file. both project and solution are units for managing project-related files. before a project starts, a member in the team needs to use the local IDE development environment to create a project. create the physical directory structure of the application. in this process, naming the directories and even working files of the Project is recommended. in short, it is best to have a set of basic frameworks for applications when adding projects to the sourcesafe database.
The following items need to be considered or implemented before preparation:
1. Various physical Directories
2. Basic static resources required (including image files, scripts, unified style sheets, media, XML, or documents)
3. project reference.
4. Basic page framework. Contains aspx sample (Template) and ascx.
After the basic framework is complete, if there is no sourcesafe database available, a database accessible to all Members should be established and each user account should be created.
Note: Due to the integrated development feature of IDE and sourcesafe, you should not set the permissions below the project level. otherwise, problems may occur. (project management by developers must be based on projects as the minimum management unit .)
After completing the preceding steps, log on to the sourcesafe server with the assigned account. Disable the visual sourcesafe client tool and open Visual Studio. net IDE, open the project, select the current project in the Solution Explorer tree structure, open the command in the file Main Menu: File/source control/Add project to source control... (add the current project to source code control ). the visual sourcesage built-in Visual Studio dialog box is displayed. select the root node ($) of the current database ). the system prompts whether to create a sourcesafe project with the same name as the current project. click Add to add the project to sourcesafe. some problems may occur during this process. generally, this parameter can be ignored.
Note: To use Visual Studio for integrated development with visual sourcesafe, you must update Visual Studio 6.0 to version 6.0c. (You must install the corresponding version of Service Pack 6 ).
At this time, the preparation process is completed.
Optional or subsequent steps
1. add the bin directory to the source code control. under normal circumstances, the project will always require the support of the existing assembly components, you should add the DLL corresponding to external references introduced for the project under the bin directory to the source code control. this is an optional step. if this step is omitted, other members are required to apply local settings.
2. set the web. config is excluded from the project. generally. config. config include to the project.
Synchronize source code
In this case, other members of the project team can obtain a copy of the source code from the server.
The recommended steps are as follows:
1. prepare a local directory with the same project name. Generally, it should be created under the wwwroot $ directory. if you need to specify different local paths for the project, you need to create a virtual directory with the same project name in Internet Information Server Manager. this process must be completed before the source code is downloaded. if any copy of the source code of the previous project is contained, clear the working directory.
2. Open Visual Studio. net ide and run the "/file/source control/open from source control" command on the main menu to open the database you just set. Log On with the allocated account and password.
3. Select the project under the root node. The system will prompt you to select the local path. Select the created path corresponding to http: // localhost/projectname. Relevant source code will be automatically downloaded.
4. The process for downloading source code is displayed. After the process is completed, the Solution Explorer window is automatically opened.
5. If the working directories defined by members are different, check the referances item. If any items are lost, fix the error.
6. If Web. config is excluded from the project, you should obtain its latest copy through other means.
7. Save the current solution. Generally, you will be prompted to save the directory of the solution file (projectname. SLU). Just save it to any directory.
8. Try to build the entire project.
Source Code Synchronization is complete.
Visual Studio settings
Special settings should be made for Vsiual studio to facilitate source code control.
The above are recommended settings.
1. Select "obtain the latest source code when solution is enabled"
2. Select "Disable solution and embed all code
3. Select "show non-prompt check out command on Pop menu"
4. Select "check in command not displayed on Pop menu"
5. If "check in is not selected, check out is maintained"
6. Select "Automatically Check out when editing the project". (check out dialog is avoided .)
7. Select "Automatically Check out when saving check in items. (check out dialog can be avoided .)
Code of work
The following lists the rules and rules that each member must comply:
1. When you open a project for the first time, you must request the latest code from the server.
2. Check the latest code from the server at the end of work.
3. Check out project or solution for a long time is not allowed. When a new project is added to the project and any program code is edited, check in project immediately so that other Members can operate the project.
4. Check out of the entire directory is not allowed. Unless necessary, check out too many items at the same time.
5. After a work step is completed, build the entire project to check the current work. If no build error occurs, check in this part of code immediately.
6. It is strictly prohibited to check the code that may not pass the build and check in. This will affect the progress of all members.