Tips for sharing case studies in web projects

Source: Internet
Author: User

Sometimes some examples of WEB projects are used in different scenarios, such as JavaScript scripts, website administrators, and third-party suites. If each example is saved in one copy, it is easy to refer to the troubles on the primary node (such as modifying the primary node of the case and forgetting to commit the primary node to the B case ), at this time, we can summarize the structure of the case and modify the design of the case to solve this problem (this is the experience of the younger brother who has recently created a solution, not necessarily the best ).

 

Information Structure

You can create a shared data volume for internal scenarios under the solution to facilitate the placement of general cases.

General case version management

The general case can be placed under the Scheme and written into the scheme as the main content. However, the lack of case sharing is that the case sharing can only be shared among the schemes, in fact, shared cases can be stored in a specific version management path and synchronized using tools, such:

  • SVNSVN: externals
  • TFS tool area for setting multiple data sources

And so on.

 

False settings are created in TFs or Svn in the following way, and shared (common resource allocation) is parallel to the solution.

 

 

Add the checkout solution resource in SVN.SVN: externalsCompile, so that the tool generates a scheme and generates shared information. After modification, the tool can be imported.

 

Add a shared map in the work area of TFS so that the tool outputs the shared information when it comes to the solution, and the shared information can be imported after modification.

 

Add case as Link

In each case, add as link is used to add the case to the general case (the presentation of the case where add as link is used to add the case will have one more line operator ), at the time of modification, the same case was modified and the latest case could be used for all solutions.

 

For example, in the two example cases, JavaScript is a case that has been shared by the younger brother for many years, because both of them are modified in the same copy and cannot be merged into different cases, the version is mixed for modification.

Note:

Vscommands 2010 provides the copy link and paste link functions, allowing you to perform a few operations.

 

Modify case proposal

The MS build setting of the web project must not expose the link content to the website, so that the problem arises when link is added to the website, because when you press F5 to merge the rows, the rows cannot be normally merged. Because the case cannot be found, you need to modify the settings of Ms build. When an issue occurs, the domain name of the legal disclaimer to the legal disclaimer.

Add _ copywebapplication target to *. csproj release.

<? XML version = "1.0" encoding = "UTF-8"?> <Project toolsversion = "4.0" defaulttargets = "build" xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"> <! -- Add the target of _ copywebapplication. Because a target can only exist in one place, apart from adding its own settings, also include the original settings --> <target name = "_ copywebapplication" dependsontargets = "$ (_ copywebapplicationdependson)"> <copy sourcefiles = "@ (content) "condition =" '$ (isdesktopbuild )'! = 'False' and '% (content. Link )'! = ''" Destinationfiles = "$ (projectdir) % (content. link) "skipunchangedfiles =" true "retries =" $ (copyretrycount) "retrydelaymilliseconds =" $ (copyretrydelaymilliseconds) "/> <calltarget condition = "'! $ (Disable_copywebapplication) 'and' $ (outdir )'! = '$ (Outputpath)' and '$ (onafter_copywebapplication )'! = ''" Targets = "$ (onafter_copywebapplication)" runeachtargetseparately = "true"/> </Target> </Project>

Note:

This method uses Web project instead of web site.

 

Result

This method has been implemented in the younger brother's case. It is easy to use. Our development environment is

Visual Studio 2010

Visual Studio (TFS 2010)

The build, TFS build, and publish of the current machine have not encountered any problems yet. If you are interested, please refer to them.

 

 

Additional information

SVN: externals description

How to: add the current project to the Project

Msbuild target

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.