Web project and source management integration in Visual Studio .NET

xiaoxiao2021-03-06  62

Summary: This article provides a policy for web projects that develop source code management in Visual Studio .NET.

Introduction

Anyone is impossible to grasp all the language, technology, tools and methods required to create a first-class software application, so most professional developers have developed in the form of a team. This is also required for efficiency and economic benefits. Similarly, most software development teams use parallel development methods so that single developers can be freed from "serial development"; the so-called serial development, that is, only when a developer completed the task, the next one Developers can start working. "Parallel Development" allows multiple developers to work "isolation" to develop the same or different parts and versions of a project in a safe way. To play a parallel development, the team must implement processes so that project developers can resolve them quickly, gradually, and automatically (in some cases) before the small conflict becomes a major conflict. Visual Studio .NET can improve the team's collaboration capabilities by ensuring sufficient development isolation.

When isolating, two or more developers can make conflict changes and ensure that at least one team member has the opportunity to review and select the appropriate solution for each conflict point. Unlike the previously released Microsoft development tools, Visual Studio .NET now supports true isolation development of Web and non-Web projects.

This article provides a team that successfully develops ASP.NET Web projects in a team, introduces Web project file management so you easily understand how to set up, develop and deploy source-managed web applications in team's form. A reliable collaborative development strategy consists of the following factors:

Source code management

Program consistency

Isolation

To ensure success, the easiest way is to use source code management solutions, projects, and other shared resources. Source management can protect team resources will not be accidentally deleted, and changes to protect single developers will not be blind or unintentionally overwritten, and you can maintain history of all project files by version. Visual Studio .NET enables source code to become an extension of project file management, thereby reducing the complexity of source code management. You do not need to leave the integrated development environment (IDE) or open another application, you can implement all source code management operations.

Understand solutions and projects

Visual Studio reduces many monotonous and complex operations in project file management and source code management. For example, when you add new items in your project, Visual Studio can save it in a location in the storage area. As long as the file is open and compiled with the project as required, you do not need to determine the save location of the file. When developing a web application, understand how Visual Studio .NET manage project files in the background, you can save you a lot of time and money for you and your team.

solution

Whenever you create a web project from the store or open an existing web project, the system will automatically create a solution that contains the project. All Visual Studio .NET solutions include a solution file solutionName.sln, which stores solution metadata, such as project lists, and its location in the storage area. The solution contains another Solution file solutionName.suo, which tracks user-specific information, such as the default save location of the Visual Studio project. When adding a solution to source management, only * .sln files will be added. Moreover, it will not check into the * .su file from the beginning to end.

From the perspective of source code management, the following two important matters about the solutions are worth noting.

The solution is local. Solutions and Web project files are stored in different locations. Unlike the file items of the web project, the solution file will never be stored on the web server unless you deliberate it on the web server (it is recommended that you don't do this). Web project files (.vbproj and .csproj) reside on the web server, and all file items in the solution file (.SLN and .SUO) and the Solution Items folder are stored by default File system folder. This is very important because it will affect the structure and manageability of the source code management web project. Create a solution instead of a project. Create a solution first, then add a project, you can maintain the logical parent child relationship between the solution and its items in the storage area. Doing so ensures that the sewage items of the multi-project solution can also help avoid some confusing issues, which may accompany some more complex source management operations, such as branches and mergers.

project

In terms of management files, Visual Studio .NET contains only two types of items: Web and non-Web projects (ie local projects).

Web project

All items created in the HTTP location of the New Project dialog box. These projects are mainly used to provide content to web browsers (ie, items called web applications), and can be used when developers need to share data between servers.

Local project

All items created in non-HTTP locations (eg, C: / MyProjects or // mycomputer / myprojects). The most common local project is used to create a Windows application.

Like the solution file * .sln, all items contain a project file to identify the physical location of each of its various in the computer file system. For example, when you add a text file to the Visual Basic ASP.NET project, its relative path will be inserted into the project file (* .vbproj).

Web project

ASP.NET Web Project is a Fast Application Development (RAD) template for web-based thin client applications. In the ASP.NET web application, the web form page provides information to the user via the browser and uses the server code to implement application logic. The web application is built around the ASP.NET, ASP.NET is a platform that contains the design-time objects and controls required to develop and run applications on the web server and runtime execution environments.

When you manage the web project under source code, you need to pay attention to the following:

Perform all available source code management operations using Visual Studio .NET.

Do not enforce source code management in a manual way. When using Add to Source Control or Check In command, all files managed by the source code will be automatically stored there.

Access method

Visual Studio accesss and manages files on the web server through one of the following methods: file sharing, this is a new feature in Visual Studio .NET; or FrontPage, it has been used in Visual InterDev. By default, use the new file sharing access method.

File Sharing

Visual Studio uses a Windows-based file management command to access the web project file. File sharing is the default web access method, which provides good support for source code management.

FrontPage

All files are managed using HTTP protocols. The source code management request from Visual Studio is forwarded to the source code management provider (e.g., Visual SourceSafe), via FrontPage Server Extensions. The source code management command supported by FrontPage Access Methods is less than the commands supported by the file sharing access method.

project files

Unlike local projects, Web projects cannot contain file items other than its project directory. When you add an existing file to a web project, Visual Studio is copied by copying the file to the Virtual Application root (virtual application root, a directory on the web server, all item items and generated output are stored here), thereby inclusion In the project.

Profile

The web.config file is a special application profile that defines its settings when designing an application. After deployment, you can change these settings without turning off the web server. Multiple configuration files named web.config can appear in multiple directories of the ASP.NET Web application server. Each web.config file applies configuration settings (such as IIS Authentication Settings) to your own directory source file.

You can create a custom profile in a Web project, override the settings in the default web.config file (for example, MySettings.config). When working in a team development environment, sometimes you need to create such files. For web projects, web.config is the only * .config file to be added to the source code.

No source code management file

Projectname.vbProj.Webinfo is a special project file for logging virtual application roots. Since each user's project work must contain its own virtual application root, the * .webinfo file does not appear in the Solution Explorer, nor will it be added to source management. Therefore, if you assign * .webinfo file, each developer's changes will be saved to your personal file without prior warnings.

In addition to WebInfo files, Visual Studio .NET does not add specific project files to source management. Most excluded files contain user-specific settings that cannot be shared. Like * .su file, the following web project files should not be added to source management:

Generate output

* .vbproj.user, *. csproj.user

* .vbproj.webinfo, *. csproj.webinfo

* .scc, .vspscc, .vssscc, etc.

Contains all profiles set by users who can overwrite the standard web.config file.

· All files hidden in the Solution Explorer (except aspx.vb and aspx.resx files) by default.

Web reference, web project and source management integration

"Web Reference" is the generated proxy class, indicating the features provided by the deployed XML Web Service. In the ASP.NET Web project, the URL represents a web reference, which can be both static or dynamic. The default value for the web reference URL property is static. When departing a web application in the team, in some cases you need to change this property to dynamic. For those solutions that use source code management and develop solutions that include ASP.NET web applications and Web Service projects, it is recommended to use dynamic URLs. In some cases, the web reference may be valid for one user and is invalid for another user. If this happens, you can use the profile to define and store the relative paths of these shared resources in your personal profile. Establish a source code management strategy

Source code management is just a tool to work in software development. It makes parallel development easier, and it can also be developed, but it does not ensure that these two functions are implemented. A team can only discover the maximum potential of the source code management only by establishing a strategy and insisting on execution. When developing a Web project, you must choose a working method from the following various types:

Local host and remote host

Discuss the important difference between the local host and the remote host file sharing web project.

Web Access Method

Define and compare the FrontPage and File Sharing Access Method.

Sharing checkout

Environments that disable exclusive checkout mode so that developers can edit the same files at the same time.

Local host and remote host

In a team development environment, the position of the original save file sharing web project is critical. If you save a work replica of a web project to a subdirectory of http: // localhost, the web project will be considered as "local host project". If a copy is saved to a non-"local host" (eg http: // Teamserver / WebApplication1), the project is considered "Remote Host Project."

The local host project is commissioned locally. Remote debugging remotely. But before you debug the remote host web project, you must let the member of the computer administrators group award you Debugger User permissions.

In Visual Studio .NET, http: // localhost is the default location of the web project and is also recommended. At one of the following cases, you need to save the project's work copy to the remote host location:

Your PC cannot be used as an IIS web server.

You need to perform pre-deployment tests and debug on the production server.

In most practical conditions, the performance of the team used to deploy its web application is much more powerful than their development computers. Before deploying a web application to such a server, you can open them from the source code management (in your own computer), set the location of the working copy item in the virtual directory of the production server, then run and debug the project . On the production server, you can test time and concurrency issues, which may not be displayed on desktop computers with poor performance. Developed on a computer, then uses applications that are commissioned with another computer that is similar or identical to the production server environment, which is often easy to deploy, and the cost is low.

Note: When a user starts debugging, the debug process will lock the shared web server to effectively prevent other users from using the server before stopping debugging.

Web Access Method

Web Access Method Specifies how Visual Studio gets write permissions on web project files on the web. The method you have chosen has a significant impact on the WEB project managed by the source code. Always use the same web access method for each web project to avoid confusion of the team.

Visual Studio provides two web access methods, "file sharing" and "frontPage". File sharing is a new feature, which is the default web access method of most Visual Studio .NET Web projects, but also the access method recommended. File Sharing

This is the default access method. File Sharing web application resides in a shared network location. When you create a web application, you need to provide an HTTP address for the project, and Visual Studio resolves the address to a Unified Naming Convention (UNC) shared. The operation performed by the project will use UNC addressable network sharing; use direct file access and HTTP access by combining, editing, saving, compiling and running and running the project on the network location.

When you open a Web project from source code, Visual Studio creates a copy of the master copy of the project source code management in your work folder (such as http: / localhost / webApp1). The work folder can be located on any web server, but when developing in a team, select the correct position.

The figure below illustrates how many developers are in isolation, using the file sharing web access method to securely develop the master web project.

figure 1

Since each developer edits a copy of the master Web project, the file sharing web access method supports sharing. By sharing or multiple checkout, many users can edit project files simultaneously and save changes to the project files without worrying if they may override another user changes. For professional development teams, it is recommended to work in sharing or multi-check mode because it will help parallel.

File Sharing Web Access Method is more advantageous than FrontPage because it:

Support sharing checkout. By sharing, multiple users can check out and edit any files, even if other users have signed the file.

Support advanced source code management commands, such as Branch, Merge, PIN, and Label.

Allow isolation. Team members can edit shared files on their personal computers, and then consolidate changes, without override the team's master copy.

Use any source code management provider that is compatible with Microsoft Source Management Interface (MSSCCI). The FrontPage Access Method is only available for Visual SourceSafe.

FrontPage Server Extensions

You can also configure Visual Studio using FrontPage Server Extensions to access Web project files. On the server created the application, FrontPage is integrated with Visual SourceSafe. The source code management request from Visual Studio is forwarded to the server installation of Visual SourceSafe via FrontPage Server Extensions.

There is a working copy when developing a FrontPage web project in Visual Studio .NET. Single version project resides on the IIS Web server, which is managed using the HTTP protocol. The figure below illustrates how two developers interact in the version controlled FrontPage Web project environment.

figure 2

Note: You cannot use Visual Studio to use Visual Studio via FrontPage Server Extensions, you must manually add the item manually on the web server that creates the project.

For most applications, it is recommended that the Team does not use the FrontPage Web access method in Visual Studio. Because it is not conducive to effective parallel development. The FrontPage Web project management of source code is developed in a serial manner: a developer edits a file. However, in some cases, you must use the FrontPage Web access method. Note: If your team is connected in a LAN or VPN mode, you can upgrade an existing web project to a new file sharing access method.

Sharing checkout

For most professional development teams, it is recommended to use a shared checkout (or multi-check mode). By sharing, multiple users can check out and edit any files, even if other users have signed the file.

If you are accustomed to working in exclusive checkout, the consolidation conflicts caused by shared (unable to solve overlapping changes) is less than the imagination. If a conflict occurs, the source code management provider usually provides a simple way to determine which changes need to be retained, which changes need to be givenover.

If the team does use a shared checkout mode, do not use the Check In command without using the project item in the IDE, do not use the Check IN command. After obtaining the latest version from the source code management, you can merge personal changes to the version master copy (if you have changed after the last check out), save the merged items to the work folder, then test the project to ensure It still works normally. If you attempt to check into a file from the last check out without getting the latest version of the Web project, you may overwrite the work version with a corrupted version. In this case, you have two options, but both choices will not be satisfactory:

The project can be debugged on the web server. But for the ASP.NET Web project, doing this may prevent other developers from using the item before your work is completed.

In the source code management, you can return to the normal version of the nearest host copy, and the changes to the work replica will be lost since the last check out project. This method will lead to data loss, so it is recommended that you do not use it. Alternatively, it is best to perform GET (acquisition) operation on your own computer and merge, not to perform check in and merge on the server.

The source code management provider handles the shared checkout in a different way. If you are using Visual SourceSafe 6.0c, you are signed by default.

Realize sharing checkout in Visual SourceSafe 6.0

1. On the Source Management Server, click the Start button, point to "Programs", point to "Microsoft Visual SourceSafe", and then click Visual SourceSafe 6.0 Admin.

2. Click Users, click Open SourceSafe Database, select the appropriate database, and then click Open.

3. In the Tools menu, click Options.

On the General tab, select Allow MultiPle Checkouts (allowing multiple checkouts), then click OK.

Collaborative development model

For web projects, collaborative development models are determined by the following two factors, namely: Web access methods for each item and developers save their work replica. There are three main modes: isolation and development

Semi-separated

Non-isolated development

Isolation development

In this mode, each developer can edit, run, and debug, and save the incremental change to the personal work copy of the master WEB project of the source code management. Developers save a copy of the local host location on their personal web server. Each member is indirectly interacting through the main control project of source code. Team members can handle the same files simultaneously because their source management provider can adjust all version conflicts in two ways: Automatic adjustment or prompting members to manually merge conflicts automatically. The figure below illustrates how the source code management is separated between the developers of the file sharing web project and is not affected by each other.

image 3

Using "Local Mode", developers can create a web project in http: // localhost / projectname. When the project developer opens the project from the source code management, they save the work replica to the same relative to the URL address of the personal web server, namely http: // localhost / projectname.

Tip: Even if you do not save your copy to your local host location (such as http: // productserver / webapp1), you can still completely isolate if your teammates do not save their work copies to the same web server. Save your work to the remote web server to perform pre-deployment test and debug (lookup timing and concurrency issues) in the project's production environment.

Advantage

To create, access, and manage web references more easily in isolation mode compared to the creation of items in semi-quarantine or non-separated development environments.

Two or more developers can simultaneously debug an ASP.NET application on their respective servers.

Compared with other collaborative development modes, the hardware, software, and server management costs of isolation mode are very reasonable.

Support advanced source code management functions, such as shared (multiple) checkouts, as well as Merge, BRANCH, PIN, and Label.

Can be used with any MSSCCI-compatible source management provider.

Disadvantage

In some cases, it is not possible to actually test (for example, using an analog / agent and there is a hop limit, or the speed of the production server is much faster than the development of the computer).

Each developer must be responsible for configuring IIS settings, and don't do this when a copy store is stored on a central Web server.

All developers must have access to the same LAN or VPN.

Semi-separated

In this mode, create a file sharing web project by a team member, then use the source code management service integrated with Visual Studio .NET to add the item to the source code management. Other developers open the project from the source code management and edit the working copy of the main web project in isolation. However, they use the shared resource of the remote web server to run and debug. Unlike isolation development modes, developers save their work copies to the public web server. Multiple developers can still check out and edit the same files at the same time, but only one developer can run and debug applications on the web server.

The following figure shows the relationship between the developer and its work copy between the shared web server when the file sharing web project is shared by the source code management.

Figure 4

Using semi-quarantine modes, developers can create a web item (for example, http: // Teamserver / WebApp1_deva) on the remote server, and then add it to source management. When the project developers open the project from the source code management, they use different project names to save their work copies in different locations on the same remote web server (for example, http: // Teamserver / WebApp1_DEVB). Unlike simple isolation development modes, developers cannot use the same name as other developers to reference the copy. Advantage

Hardware cost is low, and each project only needs a set of enterprise software licenses.

Teams can have a network administrator, specializing in sharing development resources management.

No need to access http: // localhost. No need to install IIS on each developer's computer.

Support advanced source code management functions, such as shared (multiple) checkouts, as well as Merge, BRANCH, PIN, and Label.

Can be used with any MSSCCI-compatible source management provider.

Disadvantage

When remarks when remarks, the debug process will lock the shared web server to prevent other users from using the items on the same server.

Web references cannot be shared automatically.

All developers must have access to the same LAN or VPN.

Non-isolated development

In this mode, developers are not working on the WEB project's work, but all team members have edited them directly, and change their changes to the host copy of the FrontPage Web project. Developers cannot work in parallel, and they cannot be easily separated from other developers. The figure below illustrates how two developers interact in an insequent web project (configured in IIS to use an external version control) environment.

Figure 5

Unlike file sharing projects, in IDE, you cannot add the FrontPage Web project to source management, and change its version control status in IIS. BUILT IN (Built-in) and Use External (Use External) These two IIS version control options can enforce exclusive checkout, allowing only one developer to write operations on a certain moment. The difference between these two version control options is that the BUILT IN will not send the latest version to source management when checking, and the update version is sent to source code management. For the FrontPage Web project, it is recommended to use the USE External option.

Advantage

Team members do not have to be connected via LAN or VPN.

Disadvantage

Multiple checkouts are not supported.

Cannot provide the same file security level as other modes. For example, if someone deletes a project file from the web server when using the Built IN version control, you cannot recover the file from the development of team members.

You cannot use the FrontPage Access Method to add a web application to the source code management within Visual Studio.

Advanced source code management functions are not supported, such as shared (multiple) checkouts; or Merge, BRANCH, PIN and LABEL and other orders.

Can only be used with the Visual SourceSafe source management provider.

The project must be saved in the NTFS partition.

In the FrontPage Web project, any user can disable or enable source code management if you have administrator privileges, regardless of administrator privileges.

Select a collaborative development mode: Web project creation

This section can help you quickly select and implement a policy to develop asp.net web projects in a team form. Please answer the questions in the table below to find collaborative development models for your team. After selecting a mode, you can use the suggested steps to create your web project and add it to source management.

Figure 6: Determine how to create a web project

Isolation Development: Create a web project for source code management

For most of the Web projects created in Visual Studio .NET, it is recommended that you use quarantine development modes.

Select web access method

1. On the Tools menu, click Options.

2. In the Options dialog box, click the Projects folder, and then click Web Settings.

3. Under Preferred Access Method, click File Share (file sharing).

By creating a blank solution, you can improve the long-term manageability and searchaibility of the project can be improved in it. You can also maintain the close symmetry between local project files with their master copies on the source code management server.

Create a solution directory

1. On the FILE (File) menu, point to New, then click Blank Solution.

2. In the New Project dialog box, type the name and location of the solution.

Tip: Select a name that can be explicitly identified as a solution (for example, Salesweb_solution or Salesweb_soln).

Create a web project

1. On the FILE (File) menu, point to Add Project, and then click New Project.

2. In the Add New Project dialog box, select Visual Basic Projects (Visual Basic Project) or Visual C # Projects from the left pane.

3. Select a web project template in the right pane.

4. In the Location box, type http: // localhost / projectname (where ProjectName is the name of the new project, and then click OK.

Now you can add the web project to source management so your teammates are used in development.

If possible, add the item to the source code management database that allows shared checkout or multiple checkout.

Add a Web project (and its solution) to source code management

1. In the Solution Explorer (Solution Explorer), right-click the Solution Node, and then click Add Solution To Source Control (add the solution to source management).

2. If you display a message box, click Continue. 3. Provide database locations and user login information as required by the source code management provider.

4. Create root solution directories on the source management server by specifying the server location of the solution file.

5. Under the root solution directory, type the name of the project folder, which will contain the master copy of the web project file.

Note: To add a second project and follow-up project to source management in this solution, check into the solution after the change is completed.

To make full use of isolation development mode, the project developers must separately specify the same relative address (http: // localhost / projectname) of the project work copy (http: // localhost / projectname) when the web project is first managed from source code management.

Half separation: Creating a source code management web project

Although the semi-separated development mode is better than non-separated development mode, it helps to work with isolation mode.

Select web access method

1. On the Tools menu, click Options.

2. In the Options dialog box, click the Projects folder, and then click Web Settings.

3. Under Preferred Access Method, click File Share (file sharing).

By creating a blank solution, you can improve the long-term manageability and searchaibility of the project can be improved in it. You can also maintain the close symmetry between local project files with their master copies on the source code management server.

Create a solution directory

1. On the FILE (File) menu, point to New, then click Blank Solution.

2. In the New Project dialog box, type the name and location of the solution.

Tip: Specify a name that can be explicitly identified as a solution (such as Salesweb_solution or Salesweb_soln).

Create a web project

1. On the FILE (File) menu, point to Add Project, and then click New Project.

2. In the Add New Project dialog box, select Visual Basic Projects or Visual C # Projects.

3. Select a web project template in the right pane.

4. In the Location box, type http: // servername / ProjectName (where ServerName is the name of the web server, ProjectName is the name of the new project), then click OK.

Now you can add the web project to source management so your teammates are used in development.

Add a Web project to source code management

1. In the Solution Explorer (Solution Explorer), right-click the Solution Node, and then click Add Solution To Source Control (add the solution to source management).

2. If you display a message box, click Continue.

3. Provide database locations and user login information as required by the source code management provider.

4. Create root solution directories on the source management server by specifying the server location of the solution file.

5. Under the root solution directory, type the name of the project folder, which will contain the master copy of the web project file.

At this point, the project is ready and can be developed. Now, each project developer must open the project from the source code management in accordance with the first step of opening an existing Web project.

Non-quarantined development: Creating a web project for source code management

Use the following steps to create a source code management web project for non-separation development.

Select web access method

1. On the Tools menu, click Options.

2. In the Options dialog box, click the Projects folder, and then click Web Settings.

3. Under Preferred Access Method, click FrontPage.

By creating a blank solution, you can improve the long-term manageability and searchaibility of the project can be improved in it. You can also maintain the close symmetry between local project files with their master copies on the source code management server.

Create a solution directory

1. On the FILE (File) menu, point to New, then click Blank Solution.

2. In the New Project dialog box, type the name and location of the solution.

Tip: Specify a name that can be explicitly identified as a solution (such as Salesweb_solution or Salesweb_soln).

Create a web project

1. On the FILE (File) menu, point to Add Project, and then click New Project.

2. In the Add New Project dialog box, select Visual Basic Projects or Visual C # Projects.

3. Select a web project template in the right pane.

4. In the Location box, type http: // servername / ProjectName (where ServerName is the name of the web server, ProjectName is the name of the new project), then click OK.

Now you can add the web project to source management so your teammates are used in development. Note: If you already have FrontPage Server Extensions 2002, some of the following steps may be slightly different.

Open external source management for FrontPage Web projects

1. Right-click My Computer, click Manage, and then click Services and Applications (Service and Applications).

2. Open Internet Information Services, then expand the default web site (default Web site).

3. Right-click the web where the FrontPage Web project is located, and then click Properties.

4. In the Properties dialog box, click the Server Extensions tab, set the version of the Version Control box to Use External, and then click OK.

5. For all warning messages that may be displayed, click OK.

At this point, the project is ready and can be developed. Now, each project developer must open the project from the source code management in accordance with the first step of opening an existing Web project.

Open an existing web project for the first time

This section can help you determine how to open the web project from source code and determine the best location for saving a copy (for file sharing web projects). Answer the questions in the table below and consult other project developers to determine the best way to open existing, source code management web projects for the first time.

Figure 7: Way to determine the way to open the source code management

Note: For developers who are opening a file sharing web project (to make a sure to the first question), you need to ask the project owner to save the copy of the work. For isolation development, save it in http: // localhost / projectname. For semi-separation, use a non-local host URL to save a copy.

Isolation Development: Open Web Project for the first time

1. On the FILE (File) menu, click Source Control, and then click Open from Source Control (Open from Source Management).

2. Find the web item you want to open in the appropriate source code management database, and then click OK.

3. When the system prompts you to provide a local working copy, type http: // localhost / projectname, where ProjectName is the same as the name of the source of the source code management.

Note: When you open the project next time, please do not use the Open from Source Control command, and you should use the Open Project command as you open any other items.

Half separation: Open the web project for the first time

1. On the File menu, point to Source Control, then click Open from Source Control (Open from source code). 2. Find the web item you want to open in the appropriate source code management database, and then click OK.

3. When the system prompts you to provide a local save location or a copy location, type http: // servername / projectname_myname, where ServerName is the name of the shared web server, the projectName is the same name as the source copy of the source code, _MYNAME is you Name or initial abbreviation.

Note: When you open the project next time, please do not use the Open from Source Control command, and you should use the Open Project command as you open any other items.

Non-quarantined development: Open the web project for the first time

1. On the File menu, click Open, and then click Project from Web (Web Project).

2. If the system displays the Web Access Failed dialog (usually displayed this dialog), click the Try to Open The Project With FrontPage Server Extensions button, you can use the FrontPage Server Extensions to open the project button.

Note: When you open the project next time, please do not use the Project from Web (Web Project) command, and you should use the Open Project command as you open any other items.

Backstage source code management integration

The following sections describe the case where you add a web project to source management or initiate from source code to open an item from source code.

What happens when adding a web project solution to source management?

When you add a file sharing web project to the source code management, the following conditions appear:

Receive the message: "You are attempting to add some File Share Web access projects to source control.If you continue, you will no longer be able to open these projects using FrontPage Web access." (You are trying to certain file-sharing Web Access project Add to source management. If you continue, you will not be able to use FrontPage Web to open these items.) This is a regular notification message.

Master copy, solution file Your source code management provider prompts you to specify the source code management server location for the master copy of the solution file. The provider then copies the corresponding solution item to that location. Solution files containing user-specific settings will never be added to source management.

Master copy, the project file system will prompt you to specify another server location for the project file. Be sure to locate the project file in the subfolder of the solution. All can share project files will be copied from its location on the web server to the source management server.

If the solution contains multiple items, the system will prompt you to specify a different server location for each project.

The Solution Binding Source The Administration Provider will create bindings or relationships between the work folder in the work folder in a prompt manner. In this process, most source code management providers create one or more data files on the root of the work folder to store source management information. The project binding source code management provider will repeat the previous process. Since its working copy resides in the root directory different from the solution work, the source code management provider will create a separate project binding.

The figure below illustrates how to bind the project's working copy to the master copy under the source code management. Since the file is located in a different root directory, you need to create two bindings for a simple solution Web project.

Figure 8

What happens when you open a web project solution from source code?

The following cases occur when the Web project is shared from the source code management in Visual Studio .NET:

Create a binding for the solution file. Your provider requires you to identify your personal work folder for the solution file. This action creates a relationship or binding between the work folder in the source management database and its master copy. This process typically includes creating a data file in the root directory of the work folder. The default location of these files is the personal Visual Studio project directory.

The solution file is copied to the work folder. Your Source Management Provider will create a copy of all solution files in the selected work folder.

Set the location of the web file. In the Set Project Location dialog, the provider will prompt you to identify your personal work folder for each web project in the solution. This will create another binding between the work folder and it in the main control folder on the source management server.

The project file is copied to the work folder. Finally, the source code management provider will create a copy of all WEB project files in the selected work folder.

General prompt, pay attention to and guide

Create a blank solution and add your item to it. Doing so, you can organize project files on disk (Work Copy) in an organization of the project file in the source code management database (master copy). Mandatory implementation of parallel organizations can improve the long-term manageability of project documents and make it easier to perform certain advanced source code management operations such as branches and mergers.

When adding a web reference in the ASP.NET project to the Web Service project on the same web server, use the absolute path, such as http: // servername / webservice1.

Do not change the web access method of the project after adding the project to the source code management.

When you open a web project for the first time, use the Open from Source Control on the Source Control (Source Management) submenu from the File menu. In the future, you can open the item from the local disk as any non-managed Web project:

For file sharing projects and FrontPage Web projects, click File, point to Open, and then click Project.

To sign a file sharing web project, developers must have access to LAN or VPNs residing for project master copies.

If you want to use a laptop to use it at night, be sure to check out the file you want to edit before disconnecting the network. Don't use offline check out with Visual SourceSafe.

When developing the FrontPage Web project, use the Use External (using External) Version Control options to be better than using the Built IN option. Use External You can prompt Visual Studio to save each check-in version into the source code management database, while Built IN is not prompted. Allow a shared sign as much as possible.

This operation should be performed if you may perform source code management operations on a solution to a Web project. For example, if you want to check out an ASP.NET web application project, check out its solution.

The independent version of the source code management provider is used to perform an operation that cannot be completed in the IDE (for example, branch and merge branch).

Use dynamic URL references.

If your source code management provider is Visual SourceSafe, then you will always save your web page using an ANSI code.

Do not store the work replica of the solution file on the IIS Web server.

· If you use FrontPage to access the web application created on the server's FAT or FAT32 partition, source code management will not work properly. Since the FAT partition is unable to provide a sufficient security environment, all operations will be performed by the same guest account IUSR_MACHINENAME. This way, when you try to perform an inspection or check out, you will cause your file to be incorrectly displayed to give another user in an exclusive way. This problem can be solved by disabling anonymous access to the project in the IIS Management tool, but this solution is not supported. Therefore, it is highly recommended that you convert the FAT partition to the NTFS file system.

common problem

What method can I deploy my web application to the web?

Get the latest version from the source code management, check into your changes as needed, and then copy the master copy of all item files to the appropriate production server location using the Copy Project command.

When the location of each project changes, how can my team avoid deleting the same web reference?

You can configure a web project to accept dynamic URL web references.

Why do you have so many dialog box when you create a web project? Why do you have to set the project position twice?

You may have noticed that Visual Studio will create a new solution when you create a new project without a solution. Solutions containing Web projects are not different from solutions that contain non-Web projects. That is, they initially contain two files (Solutionname.SLN and SolutionName.suo), and by default, the two files are saved to the location of the Visual Studio project on the disk. On the other hand, the Web project file must be saved to the virtual directory.

As long as you add two or more (eg, solution files and project files), your source code management provider creates a link file in the root of these items. If these items share an root directory, the provider will create a link file in the lowest level of public root directory. If these items do not share a public root directory, for example, some items have been left on disk, while others reside in virtual memory, providing programs to create a link file in two locations. Therefore, when you add a web project solution to the source code management, the provider will prompt you to identify the work folder, once used for the logo solution, and use it for identification items. What method can automatically notify Team members about Web Service changes to ensure timely refreshing all client references?

Visual Studio .NET does not provide such tools. Editing Team members of Web Service must inform other team members related to changes.

I have four developers in the team, two of which work positions outside the enterprise network. Which collaborative development model should we use when developing a web application project?

Use non-isolated development modes.

Frequently Asked Questions for Visual InterDev Developers

Is my team working in local mode? In VID, each developer works offline, saving the changes to the local working copy, and then update the primary server version. Can you do this in Visual Studio .NET?

can. Unlike the clear identity in the IDE, the local mode is the method of using the default when developing a Web project in Visual Studio .NET. To use local mode, use quarantine or semi-separated development mode.

Is my team working in the host studio ?NET?

can. You can set your web access mode to FrontPage and use non-separated development modes. However, in the compiled ASP.NET environment, non-isolation mode is often not recommended for team development.

In Visual Studio .NET, how do I publish my work on or to synchronize changes to the primary server?

Unlike VIDs, there is no Release Working Copy command in Visual Studio .NET command. To update the production server (primary server) in Visual Studio .NET, you must deploy one of several ways. The first step in deploying the ASP.NET project is to update the master copy of the source code management. The second step is to copy the project file to the production server.

How can I delete my project from source code management as in VID?

On the FILE (File) menu, click Source Control, and then click Change Source Control (Change Source Code Management). In the Change Source Control dialog, select the item you want to delete from the source code management, and then click Disconnect.

Work Replica This term is the same in Visual Studio .NET is the same as the meaning in the VID?

Not exactly the same. In VID, a copy of the work refers to the version of the Web with write permissions. In local mode, your local version is a copy. In the master mode, your master copy is a copy.

For file sharing web projects in Visual Studio .NET, the copy is always for your personal version. For FrontPage Web projects, all team members saved changes to the same master copy. How to synchronize my changes to the server when I work on my working copy (local version)?

As mentioned earlier, only the copy of the WEB project is only available. In the file sharing project, the master copy resides in the source code management database and cannot be accessed using the browser. To synchronize the changes made to the work copy with the master copy of the source code management, obtain the latest version from the source code management, generate a project in Visual Studio, and then check into the project.

Appendix A: Setting up Dynamic URL Web Reference

If you create a solution that includes both an XML Web Service, an ASP.NET Web project, and a web reference is valid for you from your ASP.NET project, the web reference is valid for you and is invalid for other users.

Team members cannot always share web references because Visual Studio stores these references to static and hardcoded strings in the web.config file. If all team members set their own copy of the project location to http: / localhost / projectname, this problem does not happen, because doing so can effectively specify the relative path of the physical location http: // computername / ProjectName.

For non-local host projects, you can solve this problem by converting a static web reference URL in the project's web.config file to dynamic properties. You should use dynamic properties to configure applications so that the partial or all property values ​​of the attribute are stored in an external configuration file instead of being stored in the compiled code of the application.

Tip: Because you or any other user can change the property value at runtime, you can use dynamic properties to quickly and easily test different web services.

You can also use dynamic properties to make your Windows application easier for testing, deployment, and management.

The following steps describe how to effectively share web references when the Web Service on the same server in which the calling project is located is referenced. These steps assume that you have created a file sharing web project called WebApplication1 on the server named Server1, and you have added a Web reference to WebApplication1 that references WS1.

Tip: By opening service1.asmx, switching to code view, then deleting an comment from the corresponding code line of the Hello World, you can quickly create the web service. In order to distinguish these two services at runtime, "Hello World" and "Hello World: WS2" are changed in their respective documents.

Under source code management, make Web references URL dynamic configuration and sharing

1. In the Solution Explorer (Solution Explorer), expand the Web References folder and select the appropriate service.

2. In the Properties window, change the value of the URL BEHAVIOR Change to Dynamic (Dynamic).

Assume that your web service returns a type of content, Visual Studio automatically adds the following code to the web.config file: 'Visual Basic // C #

In this example, the keyword properties identifies the name of the web reference, and the value of the value attribute identifies the target.

3. In the Solution Explorer (Solution Explorer), right-click WebApplication1, point to Add, and then click Add New Item.

4. In Add New Item - WebApplication1 (Add New Item - WebApplication1) dialog box, select Text File.

5. In the Name box, type User.config, and then click Open.

6. In the user.config file, paste the following code:

value = "http://localhost/ws1/service1.asmx" />

7. Open Web.config, change it to, then delete all code between start and end tags.

Now, you already have a personal configuration file that will override public settings in the web.config file.

Note: If your project is managed by source code, right-click User.config and click Exclude from Source Control (exclude from source code management). The User.config file contains your personal configuration settings.

When another user opens WebApplication1 from source code and attempts to generate an application, WS1 will be displayed as inaccessible. This problem is that the source code management public web.config file is referenced by your personal WS1 work replica storage location. To automate WS1 automatically an object accessible to other users, indicate these users to create their own personal profiles (and make sure that these configuration files are not added to source management). Each developer who opens your WebApplication1 project must perform the following steps.

Enjoy web references in the team

1. In the Solution Explorer (Solution Explorer), right-click WebApplication1, point to Add (Add), and then click Add New Item.

2. In Add New Item - WebApplication1 (Add New Item - WebApplication1) dialog box, select Text File. 3. In the Name box, type User.config, and then click Open.

4. In the user1.config file, paste the following code.

5.

6. Open the web.config file and change it to.

Switch in Web Services while running

In addition to allowing you to share web references more convenient to sharing web references more conveniently, you can quickly switch between two or more Web Services. Dynamic properties are stored in a configuration file, anyone can access the file at runtime. That is, you can change your application's behavior by editing the resource that is open to use and has not compiled (User.config files). The following steps are a short demo.

Switch between WS1 and WS2 at runtime

1. In WebApplication1, open WebForm1.aspx, then drag and drop the Label control from the toolbox to the designer.

2. Double-click the designer to switch to the code view, then paste the following code to the Page_Load event handler:

Server1.service1 a = new localhost.service1 (); label1.text = a.helloworld ();

3.

4. Generate WebApplication1.

If you have performed all the steps in the previous process, you can see Hello World: WS1.

5. Open C: /inetpub/wwroot/webapplication1/user.config at the Code Editor.

6. Change value = "http:/localhost/ws1/service1.asmx" to value = "http:/localhost/ws2/service1.asmx" and save your changes.

When you run WebApplication1 next time, you can see "Hello World: WS2" instead of "Hello World: WS1".

Appendix B: Change Web Access Method

Changing the web access method of the project will fundamentally change the way you and your team partners interact with the master copy under source code management. It is recommended to upgrade the FrontPage project to file sharing. The file sharing project is converted to the FrontPage Web Access method only when absolutely necessary. Before performing the following steps, make sure that all items you want to change have been signed in source code management.

Choose one of the following links to learn how to change the web access method of the web project:

Upgrade from Visual InterDev project to file sharing

Upgrade from FrontPage to File Sharing

Convert file sharing project to FrontPage

Upgrade from Visual InterDev Project to File Sharing You can upgrade source code managed Visual Interdev (VID) Web to ASP.NET to access source code management using file sharing web access methods.

Note: This process can effectively bifurk your VID project into two projects under source code management. You can still view history and perform source code management operations on earlier versions of the project, but can only be done by opening the VID project in source management.

Upgrade from Visual InterDev project to file sharing

1. Open Visual Studio .NET, click Tools, and then click Options.

2. In the Options dialog box, click the Projects folder, and then click Web Settings.

3. Under Preferred Access Method, click File Share and close the dialog.

4. On the FILE (File) menu of Visual Studio. Normal, point to New, then click Project.

5. In the New Project dialog box, select a language in the left pane (Visual Basic or C #), click the ASP.NET Web Application in the right pane (ASP.NET web application ), Type location (for example http: // localhost / mynewweb), then click OK.

6. Minimize Visual Studio .NET IDE, launch Visual SourceSafe Explorer, and open the SourceSafe database that contains VID project files.

7. Open your web project folder, select all source files in the Contents pane, point to SourceSafe, and then click Get Latest Version (get the latest version).

8. In the Get dialog box, replace all the text in the to (to) box in an ASP.NET web application path (such as C: / INETPUB / WWWWROOT / MyNeweb), select Make Writable, Then click OK.

9. In Visual Studio .NET, select your item and click Add Existing Item on the File menu.

10. In the Add Existing Item dialog box, open the WEB project's work folder, select all the files that have just been copied from the source code, and then click Open.

11. Right-click the Solution Node in Solution Explorer, and then click Add Solution To Source Control (add the solution to source management). Upgrade from FrontPage to File Sharing

You can:

Improve the daily manageability and integrity of the team's ASP.NET web application resource.

Use a source code management provider than Visual SourceSafe. In the past, only Visual SourceSafe This source management provider managed to manage web projects. Many third-party source code management applications support file sharing web access methods.

In the following steps, the source code management integration of the FrontPage Web project will be disabled using the Internet Information Services (IIS) management console, and then use the Visual Studio .NET to change the web access method and re-bind the project to the source code management.

Disable source code management from FrontPage Web Project

1. Right-click My Computer, click Manage, click Services and Applications, open Internet Information Services, then expand the default web site (default Web site) .

2. Right-click the web where the FrontPage Web project is located, and then click Properties.

3. In the Properties dialog box, click the Server Extensions tab, set the version of the Version Control box to None, and then click OK.

4. For all messages that may be displayed, click OK (OK).

Now, open Visual Studio .NET, change the web access method to file sharing, then restroom the project to your personal work folder under the source code management.

Change the web access method and rebound project

1. On the IDE's File menu, point to Open, click Project from Web (Web Project), enter the URL of your web project, and then click OK.

2. In the Solution Explorer (Solution Explorer), right-click the item and click Properties.

3. Under the CommON Properties of the Project Properties dialog box, select Web Settings and change the value of Web Access Mode to File Share (file sharing). 4. In Visual Studio, turn off the Web project and its solution first, then reopen.

5. In the Solution Explorer (Solution Explorer), select the item, point to Source Control on the File menu, and then click Change Source Control.

6. In the Change Source Control dialog box, select your item, click Bind, and then click OK. Click OK for all warning messages displayed.

Note: You must restore the solutions and items to their previous save locations to keep the source code management history.

7. In the Solution Explorer (Solution Explorer), right-click the item, click Check Out, for the warning message subsequently displayed, click OK.

8. When displaying "Your Folder Contains A Writable Copy Of Project Path" message, select Leave this file, then click OK.

9. In the Solution Explorer (Solution Explorer), right-click the item and click Check IN.

Convert file sharing project to FrontPage

Before converting the file sharing web project to the FrontPage Web Access method, consider an alternative. Convert to FrontPage, you can:

Visit the design time of the design of the .NET Passport authentication.

Items that are connected or allowed to access the firewall, including one or more team members that cannot be accessed through the LAN or VPN.

Transfer from file sharing to FrontPage web access method

1. Select the ASP.NET Web project in the Solution Explorer (Solution Explorer).

2. On the FILE (File) menu, point to Source Control, and then click Change Source Control.

3. In the Change Source Control dialog, select your web project, and then click Unbind. 4. Repeat this step for each of the Change Source Control list, accept all messages displayed, and then click OK.

5. In the Solution Explorer (Solution Explorer), right-click the web project you want to convert, and then click Properties.

6. Under the CommON Properties in the Project Properties dialog box, select Web Settings, and then change the value of Web Access Mode to FrontPage.

7. Select Solutions and on the File menu, click Close Solution.

Now you can enable source code management for FrontPage Web. Some of the following procedures may differ from the steps in FrontPage Server Extensions 2002.

Open external source management for FrontPage Web projects

1. Right-click My Computer, click Manage, and then click Services and Applications (Service and Applications).

2. Open Internet Information Services and expand the DEFAULT Web Site node.

3. Right-click the web where the FrontPage Web project is located, and then click Properties.

4. In the Properties dialog box, click the Server Extensions tab, set the version of the Version Control box to Use External, and then click OK.

5. For all warning messages that may be displayed, click OK.

Appendix C: Deploying a web project

Visual Studio .NET provides a variety of powerful deployment tools, including web settings and deployment projects. The following procedure describes a simple way to extend changes in the master copy (in the source management database) to its production server location.

For web projects, you can use the Copy Project on the Project menu. Copying items (rather than deployment projects) is a simple way to move project content to the target web server. However, the replication operation cannot automatically configure the Internet Information Service (IIS) directory setting. Therefore, in most cases, we recommend that you deploy projects because it allows you to take advantage of many deployment project management functions such as registration and IIS configuration. By default, the Copy Project command creates a new web application on the target server and only copies the file you want to run to the application. FrontPage Server Extensions must be installed on the Target server to use the Copy Project command. Also, note that the web access method you use to deploy the project is completely unrespoquent with the web access method of the project in Visual Studio, nor does it change the latter. The following steps will be deployed through the HTTP.

Deploy ASP.NET Web Project

1. On the Project menu, click Copy Project.

2. Select Destination Project Folders and Servers.

3. Click the FrontPage button.

Note: In this environment, FrontPage is the default option and is also the option to use. If you use the File Share option, use the following syntax to set the PATH (path): // servername / wwwroot $ / projectname.

4. Select the file you want to copy.

The default option is only deployed to run the files required to run the application. You can also deploy all files or project folders.

Show TOC

转载请注明原文地址:https://www.9cbs.com/read-106462.html

New Post(0)