方法一:
按照如下步驟:
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