Asp.net TFS 2010构建-在构建期间注册VB 6.0 DLL

Asp.net TFS 2010构建-在构建期间注册VB 6.0 DLL,asp.net,tfs,tfsbuild,msdeploy,tfs-2010,Asp.net,Tfs,Tfsbuild,Msdeploy,Tfs 2010,我必须通过TFS2010部署一个经典的ASP站点。此站点有许多自定义VB 6.0 DLL,需要在部署过程中注销和重新注册。有办法做到这一点吗?这是我第一次体验通过TFS使用构建过程,所以它有点新。如果您想使用团队构建执行自定义任务,可以将类似这样的节点添加到TFSBuild.proj文件中。要注册DLL,可以执行以下操作: <Target Name="AfterGet"> <Exec Command="echo SolutionRoot=$(SolutionRoot)"

我必须通过TFS2010部署一个经典的ASP站点。此站点有许多自定义VB 6.0 DLL,需要在部署过程中注销和重新注册。有办法做到这一点吗?这是我第一次体验通过TFS使用构建过程,所以它有点新。

如果您想使用团队构建执行自定义任务,可以将类似这样的节点添加到TFSBuild.proj文件中。要注册DLL,可以执行以下操作:

<Target Name="AfterGet">
    <Exec Command="echo SolutionRoot=$(SolutionRoot)" />
    <Exec Command="regsvr32 /s $(SolutionRoot)\SharedBinaries\STServer.dll" />
</Target>
要访问TFSBuild.proj文件,您可以转到源代码管理资源管理器,然后转到TeamBuildTypes文件夹下,您应该会看到您的生成名称。单击该按钮,在右侧窗格中,您将看到TFSBuild.proj文件,请参见下面的屏幕截图


嗯,我解决了这个问题,虽然不完全是在TFS构建过程中。我要做的是,在构建过程完成后,运行一个MS部署脚本,该脚本将TFS发布的文件复制到远程服务器。然后,在部署文件之后,我调用另一个msdeploy命令,该命令运行已添加到项目中的VBScript文件。VBScript代码在项目中循环并重新注册它找到的所有DLL

以下是在批处理文件中调用的MS部署脚本:

msdeploy -verb:sync -source:contentpath=C:\temp\Build\_PublishedWebsites\TestSite -dest:contentPath=D:\Inetpub\wwwroot\TestSite,computername=RemoteSystem:1111
msdeploy -verb:sync -source:runcommand="D:\Inetpub\wwwroot\TestSite\RegisterFiles.vbs",waitinterval=10000 -dest:auto,computername=RemoteSystem:1111
最后,注册DLL的VBScript文件:

Set oShell = CreateObject ("WScript.Shell")

Dim FSO, FLD, FIL
Dim strFolder, strPath

strFolder = "D:\Inetpub\wwwroot\TestSite\DLLs\"

'Create the filesystem and folder objects
Set FSO = CreateObject("Scripting.FileSystemObject")
set FLD = FSO.GetFolder(strFolder)

'Loop through the DLLs in the folder
For Each Fil In FLD.Files

  If Instr(Fil.Name,".dll") Then
    strPath = strFolder & Fil.Name
    oShell.Run "regsvr32 /s /u " & strPath
    oShell.Run "regsvr32 /s " & strPath

  End If

Next

If isObject(oShell) Then
    Set oShell = Nothing
End IF

Set FLD = Nothing
Set FSO = Nothing

我没有看到TFSBuild.proj文件-它位于哪里?仍然没有看到它。您知道这是否仅限于某些用户或用户组吗?