当数据库不存在时分离 TFS 项目集合

当数据库不存在时分离 TFS 项目集合

当我将项目集合添加到 TFS 时,它在中途崩溃了。它没有为该集合创建数据库。该集合显示在 TFS 管理控制台中,但它不允许我将其分离,因为它显示

TF246017: Team Foundation Server 无法连接到数据库。请验证承载数据库的服务器是否正常运行,以及网络问题是否未阻止与服务器的通信。

我该如何摆脱这个幽灵收藏?

答案1

答案2

最好的选择是使用以下命令删除该集合。

syntax:TFSConfig Collection /delete /collectionName:[COLLECTION NAME]
TFSConfig Collection /delete /collectionName:Project( here project is name of the collection)

例如:

C:\Users> cd..

C:\> cd Program Files\Microsoft Team Foundation Server 2010\Tools

C:\Program Files\Microsoft Team Foundation Server 2010\Tools> TFSConfig Collection /delete /collectionName:Project
Logging sent to file C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_TPC_AT_0710_134506.log
Command: collection
TfsConfig - Team Foundation Server Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.
Deleting a Team Project Collection is an irreversible operation. A deleted collection can not be reattached to the same or another Team Foundation Server. Are you sure you want to delete 'Project'? (Yes/No) y
Found Collection 'Project'. Deleting...
The delete of collection 'Project' succeeded.

答案3

这对我有用...

 1. Actions to perform on TFS 2010
   1.1 Using the TFS console "Detach" the collection from the "TFS server"

   1.2 Using the SQl Manager "Detach" the database for the corresponding TFS 
       collection



 2.  Actions to perform on TFS 2012
   2.1 Using the SQl Manager "attach" the database for the corresponding TFS 
       collection

   2.2 Make sure to give the TFS user account/s access to the database otherwise 
       the TFS server will not be able to access it.

   2.3 Using the TFS console "attach" the collection to the "TFS server"

答案4

我不确定它是否会有任何副作用,但我遇到了同样的问题,我通过删除表中的行解决了它表数据库Tfs_Configuration 数据库这是通过指向丢失的数据库连接字符串场地。

相关内容