Use C # To remove the SourceSafe Management of code

Source: Internet
Author: User

I often read some programs. Some solutions have multiple projects. Because there are many codes and many developers, many projects under vs.net use source safe for version control. Source safe requires LAN path sharing for version control. Therefore, many projects may encounter some problems when switching to another machine. For example, "The solution seems to be managed by source code, but cannot find its binding information ......" And so on. Sometimes the modified Code cannot be saved, so I want to remove it. Below are some comparisons before and after project management.

1. Project comparison

Compared with projects that are not managed by Source Safe code:

1. The. scc,. vssscc, And. vspscc files are added;

2. C # add several lines of labels to the project file (. csproj:

SccProjectName = "SAK"

SccLocalPath = "SAK"

SccAuxPath = "SAK"

SccProvider = "SAK"
 
3. In the solution file (. sln), add the following node elements:

GlobalSection (SourceCodeControl) = preSolution

SccNumberOfProjects = 4

SccLocalPath0 =.

......

SccLocalPath3 = SUBSCRIBE_TOOLS

CanCheckoutShared = false

EndGlobalSection
 
Ii. Compile the implemented classes

Since the number of files has increased and some files have been modified, I want to change them back to their original state through programming. This may remove the prompt information, so I wrote the following code.

File: //************************************** *

// Procedure: Zheng ZuoZhzuocn@163.com2004/06/10

// Function: Remove Source safe management from the original code of C #. net

File: //************************************** *

Using System;

Using System. IO;

Using System. Text;

Using System. Threading;

Namespace ZZ

{

/// <Summary>

/// Operation information event proxy

/// </Summary>

Public delegate void OperateNotifyHandler (object sender, VssEventArgs e );

/// <Summary>

/// VssConverter processes the SourceSafe Association of the solution or project.

/// </Summary>

Public class VssConverter

{

File: // operationRoot directory

Private string operatePath;

/// <Summary>

/// Operation information event

/// </Summary>

Public event OperateNotifyHandler OperateNotify;

/// <Summary>

/// Thread end notification event

/// </Summary>

Public event EventHandler ThreadCompleted;


 

 

Related Article

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.