去掉VS.NET项目中的VSS代码控制

来源:互联网 发布:js延迟函数 编辑:程序博客网 时间:2024/06/10 05:09

方法一:

按照如下步骤:

1关闭Visual Studio IDE环境。

在Visual Studio IDE 运行过程中,由于共享冲突,这下面步骤是无法操作的,因此首先要关闭IDE环境。

2将项目中文件的只读属性去掉。

3、去除方案文件中的版本信息
在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

        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绑定信息,删除该块并保存。
4、去除项目文件中的版本信息
用记事本打开对应项目,在其中找到XML tag <CSHARP>,删除SccProjectName、SccLocalPath、SccAuxPath、SccProvider。代码如下
<VisualStudioProject>

    <CSHARP

        ProjectType = "Local"

        ProductVersion = "7.10.3077"

        SchemaVersion = "2.0"

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

        SccProjectName = "SAK"

        SccLocalPath = "SAK"

        SccAuxPath = "SAK"

        SccProvider = "SAK"

    >

        <Build>

            <Settings

                ApplicationIcon = "App.ico"

                AssemblyKeyContainerName = ""

                AssemblyName = "SourceSafeBindingRemover"

                AssemblyOriginatorKeyFile = ""

                DefaultClientScript = "JScript"

                DefaultHTMLPageLayout = "Grid"

                DefaultTargetSchema = "IE50"

                DelaySign = "false"

                OutputType = "WinExe"

                PreBuildEvent = ""

                PostBuildEvent = ""

                RootNamespace = "SourceSafeBindingRemover"

                RunPostBuildEvent = "OnBuildSuccess"

                StartupObject = ""

            >

                <Config

                    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

    </CSHARP>

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

    <Configuration Condition=" '$(Configuration)' =  = '' ">Debug</Configuration>

    <Platform Condition=" '$(Platform)' =  = '' ">AnyCPU</Platform>

    <ProductVersion>8.0.40903</ProductVersion>

    <SchemaVersion>2.0</SchemaVersion>

    <ProjectGuid>{951EBC65-CA21-4C24-B501-DFF2A03A03F1}</ProjectGuid>

    <OutputType>Library</OutputType>

    <StartupObject>

    </StartupObject>

    <AssemblyName>SourceSafeBindingRemover</AssemblyName>

    <RootNamespace>SourceSafeBindingRemover</RootNamespace>  

    <SccProjectName>SAK</SccProjectName>

    <SccLocalPath>SAK</SccLocalPath>

    <SccAuxPath>SAK</SccAuxPath>

    <SccProvider>SAK</SccProvider>

  </PropertyGroup>


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

方法二:

在IDE里面File->Source Control->Change Source Control,上面那排按钮里直接unbind。

方法三:(仅限于Web Application)
Project—>Copy Project
 Copy:All project files

解除VS.NET 项目中SourceSafe管理的小工具:CleanSourceSafe.rar

下载地址:http://www.cnblogs.com/Files/zzc315/CleanSourceSafe.rar

原创粉丝点击