如何去除Visual SourceSafe绑定信息

http://www.donews.net/cmic/archive/2005/05/25/398012.aspx

对于Visual Studio开发人员来说,Visual SourceSafe可能是一套最常见的版本控制工具,它与Visual Studio的无缝绑定,使用户倍感亲切和方便。但如果你向无SourceSafe环境中迁移或共享源代码,或者改变其他版本控制工具(如CVS、Subversion)时,可能会遇到麻烦。
因为Visual SourceSafe是通过大量修改项目信息,来实现版本信息的标识和管理。不仅在项目目录中加入新的控制文件;同时他还修改项目方案文件,加入相关XML元素。尽管所有这些改变对用户来说都是透明的,但要去除VSS绑定还并非易事,关键在与一下几个步骤:
1、关闭Visual Studio IDE环境
在Visual Studio IDE 运行过程中,由于共享冲突,这下面步骤是无法操作的,因此首先要关闭IDE环境。
2、去除方案文件中的版本信息
在Visual Studio 2003环境下,方案文件是后缀为.Sln的文本文件。用记事本打开,在其中找到Global块下的GlobalSection(SourceCodeControl),代码如下
Microsoft Visual Studio Solution File, Format Version 8.00

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") =

"项目名称",

"项目名称/项目名称.csproj",

"{C7687560-4B36-47E3-AF33-748E76411259}"

    ProjectSection(ProjectDependencies) = postProject

    EndProjectSection

EndProject

Global  

  GlobalSection(SourceCodeControl) = preSolution

        SccNumberOfProjects = 2

        SccLocalPath0 = .

        CanCheckoutShared = false

        SolutionUniqueID = {634C866F-3CEB-43A1-9C7F-D34A03F0A044}

        SccProjectUniqueName1 =

        项目名称//项目名称.csproj

        SccLocalPath1 = .

        CanCheckoutShared = false

        SccProjectFilePathRelativizedFromConnection1 =

            项目名称//

    EndGlobalSection

    GlobalSection(SolutionConfiguration) = preSolution

  GlobalSection(SourceCodeControl) = preSolution

        SccNumberOfProjects = 2

        SccLocalPath0 = .

        CanCheckoutShared = false

        SolutionUniqueID = {634C866F-3CEB-43A1-9C7F-D34A03F0A044}

        SccProjectUniqueName1 =

        项目名称//项目名称.csproj

        SccLocalPath1 = .

        CanCheckoutShared = false

        SccProjectFilePathRelativizedFromConnection1 =

            项目名称//

    EndGlobalSection

    GlobalSection(SolutionConfiguration) = preSolution

  GlobalSection(SourceCodeControl) = preSolution

        SccNumberOfProjects = 2

        SccLocalPath0 = .

        CanCheckoutShared = false

        SolutionUniqueID = {634C866F-3CEB-43A1-9C7F-D34A03F0A044}

        SccProjectUniqueName1 =

        项目名称//项目名称.csproj

        SccLocalPath1 = .

        CanCheckoutShared = false

        SccProjectFilePathRelativizedFromConnection1 =

            项目名称//

    EndGlobalSection

    GlobalSection(SolutionConfiguration) = preSolution

  GlobalSection(SourceCodeControl) = preSolution

        SccNumberOfProjects = 2

        SccLocalPath0 = .

        CanCheckoutShared = false

        SolutionUniqueID = {634C866F-3CEB-43A1-9C7F-D34A03F0A044}

        SccProjectUniqueName1 =

        项目名称//项目名称.csproj

        SccLocalPath1 = .

        CanCheckoutShared = false

        SccProjectFilePathRelativizedFromConnection1 =

            项目名称//

    EndGlobalSection

    GlobalSection(SolutionConfiguration) = preSolution

        Debug = Debug

        Release = Release

    EndGlobalSection

    GlobalSection(ProjectConfiguration) = postSolution

     {C7687560-4B36-47E3-AF33-748E76411259}.Debug.ActiveCfg

        = Debug|.NET

     {C7687560-4B36-47E3-AF33-748E76411259}.Debug.Build.0

        = Debug|.NET

     {C7687560-4B36-47E3-AF33-748E76411259}.Release.ActiveCfg

        = Release|.NET

     {C7687560-4B36-47E3-AF33-748E76411259}.Release.Build.0

        = Release|.NET

    EndGlobalSection

    GlobalSection(ExtensibilityGlobals) = postSolution

    EndGlobalSection

    GlobalSection(ExtensibilityAddIns) = postSolution

    EndGlobalSection

EndGlobal

其中GlobalSection(SourceCodeControl)块包含着VSS绑定信息,删除该块并保存。
3、去除项目文件中的版本信息
用记事本打开对应项目,在其中找到XML tag ,删除SccProjectName、SccLocalPath、SccAuxPath、SccProvider。代码如下

   

        ProjectType = "Local"

        ProductVersion = "7.10.3077"

        SchemaVersion = "2.0"

        ProjectGuid = "{C7687560-4B36-47E3-AF33-748E76411259}"       

        SccProjectName = "SAK"

        SccLocalPath = "SAK"

        SccAuxPath = "SAK"

        SccProvider = "SAK"

        SccProjectName = "SAK"

        SccLocalPath = "SAK"

        SccAuxPath = "SAK"

        SccProvider = "SAK"

        SccProjectName = "SAK"

        SccLocalPath = "SAK"

        SccAuxPath = "SAK"

        SccProvider = "SAK"

        SccProjectName = "SAK"

        SccLocalPath = "SAK"

        SccAuxPath = "SAK"

        SccProvider = "SAK"

    >

       

           

                ApplicationIcon = "App.ico"

                AssemblyKeyContainerName = ""

                AssemblyName = "SourceSafeBindingRemover"

                AssemblyOriginatorKeyFile = ""

                DefaultClientScript = "JScript"

                DefaultHTMLPageLayout = "Grid"

                DefaultTargetSchema = "IE50"

                DelaySign = "false"

                OutputType = "WinExe"

                PreBuildEvent = ""

                PostBuildEvent = ""

                RootNamespace = "SourceSafeBindingRemover"

                RunPostBuildEvent = "OnBuildSuccess"

                StartupObject = ""

            >

               

                    Name = "Debug"

                    AllowUnsafeBlocks = "false"

                    BaseAddress = "285212672"

                    CheckForOverflowUnderflow = "false"

                    ConfigurationOverrideFile = ""

                    DefineConstants = "DEBUG;TRACE"

                    DocumentationFile = ""

                    DebugSymbols = "true"

                    FileAlignment = "4096"

                    IncrementalBuild = "false"

                    NoStdLib = "false"

                    NoWarn = ""

                    Optimize = "false"

                    OutputPath = "bin/Debug/"

                    RegisterForComInterop = "false"

                    RemoveIntegerChecks = "false"

                    TreatWarningsAsErrors = "false"

                    WarningLevel = "4"

                />

... sections deleted

   


注意:如果这是一个VB项目,对应的Tag应该是
在Visual Studio 2005中,项目信息变化较大(它基于MSBuild),但要删除的内容却是显而易见的,如下

    Debug

    AnyCPU

    8.0.40903

    2.0

    {951EBC65-CA21-4C24-B501-DFF2A03A03F1}

    Library

   

   

    SourceSafeBindingRemover

    SourceSafeBindingRemover  

    SAK

    SAK

    SAK

    SAK

 
  4、删除所有后缀为.SCC的文件。
  最后一步信息,就是删除项目目录下所有后缀为.SCC的文件。
   其中每一目录下,都包含有文件vssver.scc
   项目文件所在目录下,包含有文件mssccprj.scc
   另外,还包括.csproj.vspscc 或 .etp.vspscc文件

    SAK

    SAK

    SAK

    SAK

 
  4、删除所有后缀为.SCC的文件。
  最后一步信息,就是删除项目目录下所有后缀为.SCC的文件。
   其中每一目录下,都包含有文件vssver.scc
   项目文件所在目录下,包含有文件mssccprj.scc
   另外,还包括.csproj.vspscc 或 .etp.vspscc文件

    SAK

    SAK

    SAK

    SAK

 
  4、删除所有后缀为.SCC的文件。
  最后一步信息,就是删除项目目录下所有后缀为.SCC的文件。
   其中每一目录下,都包含有文件vssver.scc
   项目文件所在目录下,包含有文件mssccprj.scc
   另外,还包括.csproj.vspscc 或 .etp.vspscc文件

    SAK

    SAK

    SAK

    SAK

 
  4、删除所有后缀为.SCC的文件。
  最后一步信息,就是删除项目目录下所有后缀为.SCC的文件。
   其中每一目录下,都包含有文件vssver.scc
   项目文件所在目录下,包含有文件mssccprj.scc
   另外,还包括.csproj.vspscc 或 .etp.vspscc文件

你可能感兴趣的:(c/c++/vc)