実行中のTFSサーバー用のワークアイテムストアに接続する2つの方法を試しました。試行Aは、構成サーバーに接続し、GetService<WorkItemStore>()
メソッドを使用することでした。これは常にnullを返します。TFS 2010ワークアイテムストアにどのようにしっかり接続できますか?
試行Bは、TfsTeamProjectCollectionに接続し、GetService<WorkItemStore>()
メソッドを使用するか、プロジェクトコレクションをWorkItemStoreコンストラクタに渡すことでした。試行Bでは、「エラーHRESULT E_FAILがCOMコンポーネントへの呼び出しから返されました」という例外が表示されます。私が見つけることができる唯一の情報はいくつかのアクセス許可の問題を示すようですが、プロジェクト全体のコレクションへの読み取りアクセス権を持つユーザーとして認証されていることを確認しました。
ここに私が...
public TfsConfigurationServer GetConfigurationServer()
{
Uri tfsUri = new Uri(configs.TfsUri);
TfsConfigurationServer server = TfsConfigurationServerFactory.GetConfigurationServer(tfsUri, credProvider);
server.Authenticate();
if (server.HasAuthenticated == false)
throw new InvalidOperationException("You can't authenticate against the tfs instance.");
return server;
}
public TfsTeamProjectCollection GetProjectCollectionInstance(string projectCollectionName)
{
Uri tfsUri = new Uri(configs.TfsUri + "/" + projectCollectionName);
TfsTeamProjectCollection collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(tfsUri, credProvider);
collection.Authenticate();
if (collection.HasAuthenticated == false)
throw new InvalidOperationException("You can't authenticate against the tfs instance.");
return collection;
}
、ここでは私がWorkItemStore(問題を説明するために愚かなコード)を取得しようとしている方法です...私は接続してる方法です
public WorkItemProvider()
{
if (workItems == null)
workItems = ServerProvider.ServerInstance.GetService<WorkItemStore>();
if (workItems == null)
workItems = ServerProvider.ProjectCollectionInstance.GetService<WorkItemStore>();
if (workItems == null)
workItems = new WorkItemStore(ServerProvider.ProjectCollectionInstance);
if (workItems == null)
throw new NullReferenceException("Couldn't load work item store.");
}
サーバーと同じドメインにはいませんが、ICredentialsProviderを持つドメインユーザーとして認証しており、そのユーザーとして認証されていることを確認しました。任意のポインタが役立つだろう。これは何が必要ない場合
追加情報:Windowsの認証となりすましを使用して、ドメイン内のコンピュータで同じコードが正常に動作します。私はドメイン外からこれを行うことはできないと思いますか?私はVisual Studioからすることができますので、それは理にかなっていません。たとえ私がドメインにいなくてもドメインユーザーになりすますことができますか? – sonicblis