3

API経由でビルドをキューに入れるコードを以下に記述しました。チーム プロジェクト コレクション、ワークアイテム ストア、およびバージョン コントロール サーバーは正常に動作しますが、buildserver オブジェクトを取得できません。常に null を返します。他の構成が不足していますか

using (TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://tfsserver:8080/tfs/DefaultCollection")))
{
    tpc.EnsureAuthenticated();

    // i am getting workitemstore object here
    var wiStore = tpc.GetService<WorkItemStore>();
    ....
    ....

    // i am getting version control server object here as well
    var vcs = tpc.GetService<VersionControlServer>();
    ....
    ....

    // but here i get a null object
    var bs = tpc.GetService<IBuildServer>();

    //this is what i want to do with buildserver object
    var buildDefinition = bs.GetBuildDefinition("aaa", "bbb");
    var buildRequest = buildDefinition.CreateBuildRequest();
    bs.QueueBuild(buildRequest);
}

何か案が?

4

2 に答える 2

2

Microsoft.TeamFoundation.Build.Clientこれは、接続しようとしている TFSの間違ったバージョンを参照した場合に発生する可能性があります。TFS2010 の正しいバージョン (10.0.0.0 だと思います) を参照していることを確認してください。

http://pmichaels.net/2015/03/20/unable-to-get-ibuildserver-always-returning-null/

于 2015-03-20T08:04:49.630 に答える