Can I bypass Gated Check-In build after checking a file in during a separate build process? TFS 2010

烂漫一生 提交于 2019-12-05 05:40:08

When you checkin your changes programmatically, you can create a WorkspaceCheckInParameters object and set its OverrideGatedCheckIn property to true. The following code would bypass gated checkin (and also CI):

            var pendingChanges = workspace.GetPendingChanges();
            if (pendingChanges.Any())
            {
                WorkspaceCheckInParameters parameters = new WorkspaceCheckInParameters(pendingChanges, BuildCommonUtil.NoCICheckInComment)
                {
                    OverrideGatedCheckIn = true,
                };
                workspace.CheckIn(parameters);
            }

Note that you need to grant the permission to bypass gated checkin on the account that performs the checkin for all affected build definitions. In this case, it is the build service account of the Nightly build.

I had written the Assembly Version update code in Powershell and could not find the slimier code "OverrideGatedCheckIn = true" for Powershell and all I did was moving assembly version files (SharedAssembly.vb & SharedAssembly.cs) to a folder called SharedAssembly and excluding them to considering for the GatedCheck-In process.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!