visual-studio 视觉源安全 - 如何从解决方案中删除绑定而无需在 Visual Studio 中打开

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1019664/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:40:22  来源:igfitidea点击:

visual source safe - how to remove bindings from solution w/o opening in visual studio

visual-studiovisual-sourcesafe

提问by Seth Reno

Does anyone know of a good way to remove vss source control bindings for a visual studio 2005 and 2008 solution without opening it in visual studio?

有谁知道一种无需在 Visual Studio 中打开即可删除 Visual Studio 2005 和 2008 解决方案的 vss 源代码控制绑定的好方法?

I used to use: del /s /f /a: *.*sccThen when I opened visual studio it would prompt me and give me the option to "permanently remove bindings".

我曾经使用:del /s /f /a: *.*scc然后当我打开 Visual Studio 时,它会提示我并给我“永久删除绑定”的选项。

Now when I try this it recreates the .vssscc file and tells me my working copy contains a different version of the .vsscc file. There's is no option to remove source control bindings.

现在,当我尝试此操作时,它会重新创建 .vssscc 文件并告诉我我的工作副本包含不同版本的 .vsscc 文件。没有删除源代码控制绑定的选项。

The real problem is that I'm trying to work on an old labeled copy of the solution from source safe. But, if I open the solution while it's still bound to source control it will get the latest version of the web site. It does this even though I have the option "Source Control-->Environment-->Get everything when opening a solution or project" unchecked.

真正的问题是我正在尝试从源安全的解决方案的旧标记副本上工作。但是,如果我在解决方案仍然绑定到源代码管理时打开它,它将获得该网站的最新版本。即使我没有选中“源代码管理-->环境-->打开解决方案或项目时获取所有内容”选项,它也会这样做。

回答by Seth Reno

I got this to work by editing the solution file as well as deleting the *.*scc files.

我通过编辑解决方案文件以及删除 *.*scc 文件来实现这一点。

Here's what I removed from the solution file:

这是我从解决方案文件中删除的内容:

Under the section:

在该部分下:

ProjectSection(WebsiteProperties) = preProject

I removed the following 4 lines:

我删除了以下 4 行:

        SccProjectName = ""$/HOS_amend.root/HOS", ENWBAAAA"
        SccAuxPath = ""
        SccLocalPath = ".."
        SccProvider = "MSSCCI:Microsoft Visual SourceSafe"

Also removed the entire section:

还删除了整个部分:

GlobalSection(SourceCodeControl) = preSolution

After doing this when I open the solution I get the prompt with the option to "permanently remove bindings".

执行此操作后,当我打开解决方案时,我会收到带有“永久删除绑定”选项的提示。

回答by Murugesan Yadav

In Visual Studio

在 Visual Studio 中

  1. open your project,then goto
  2. File-->Source Control-->Change Source Control.
  3. select the project and/or solution
  4. click Unbind.
  1. 打开你的项目,然后转到
  2. 文件--> 源代码管理--> 更改源代码管理。
  3. 选择项目和/或解决方案
  4. 单击解除绑定。

You also need to change read only attributes of all the files to read/write in order to be able to modify them later.

您还需要将所有文件的只读属性更改为读/写,以便以后能够修改它们。

回答by TheDorkKnight

This is the .cmd file I use to remove all source control files:

这是我用来删除所有源控制文件的 .cmd 文件:

:: *.scc
:: ===========================================================================

attrib /s -h -s "*.scc"  :: Must get rid of system and hidden attributes
attrib /s -r "*.scc"     :: at same time
del /s "*.scc"

:: *.vssscc
:: ===========================================================================

attrib /s -h -s "*.vssscc"
attrib /s -r "*.vssscc"
del /s "*.vssscc"

:: *.vspscc
:: ===========================================================================

attrib /s -h -s "*.vspscc"
attrib /s -r "*.vspscc"
del /s "*.vspscc"

:: *.vsscc
:: ===========================================================================

attrib /s -h -s "*.vsscc"
attrib /s -r "*.vsscc"
del /s "*.vsscc"

After which you can either open in Visual Studio and get prompted to remove source control bindings (which removes the lines mentioned by Seth Reno, ie.

之后,您可以在 Visual Studio 中打开并提示删除源代码控制绑定(删除 Seth Reno 提到的行,即。

    SccProjectName = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    SccAuxPath = "x"
    SccLocalPath = "xxx"
    SccProvider = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

)

)

Or you could do some kind of regular expression removal, but I don't have code for that.

或者你可以做某种正则表达式删除,但我没有代码。

回答by jerry

Just search your project for *.scc and .vss, delete all these, then open your project in Visual Studio 2008, which will ask you if you want to remove bindings or fix it

只需在您的项目中搜索 *.scc 和.vss,删除所有这些,然后在 Visual Studio 2008 中打开您的项目,它会询问您是否要删除绑定或修复它

回答by RBarryYoung

I am not sure of the "best" answer, but I can supply some information: First the only sure fire way that I have come up with to separate a VS2005/2008 project or solution and VSS is to create a new solution and project with the same settings, in new folders, copy all of the modules, classes, forms etc. member files over and then add them to the project and finally, reset all of the project and solution attributes to match.

我不确定“最佳”答案,但我可以提供一些信息:首先,我想出的将 VS2005/2008 项目或解决方案与 VSS 分开的唯一可靠方法是创建一个新的解决方案和项目相同的设置,在新文件夹中,复制所有模块、类、表单等成员文件,然后将它们添加到项目中,最后,重置所有项目和解决方案属性以匹配。

If someone has a better reliableway to do this I would love to hear it, but so far everything else that I have tried has resulted in breaking both the project/solution and the VSS integration.

如果有人有更可靠的方法来做到这一点,我很乐意听到它,但到目前为止,我尝试过的所有其他方法都导致了项目/解决方案和 VSS 集成的破坏。

AFAIK, the cause of this is that the binding between VSS and VS projects in the solution.SSC, solution.VSSSCC, solution.SLN, mssccprj.scc, vssver.ssc, and *.%proj files and maybe in the SUO as well (ugh!).

AFAIK,这是因为在solution.SSC、solution.VSSSCC、solution.SLN、mssccprj.scc、vssver.ssc和*.%proj文件中VSS和VS项目之间的绑定,也许在SUO中也是如此(啊!)。