WEB API を介して workItem を TFS "ONLINE" に送信しようとしています。ローカル マシンでは正常に動作しますが、共有ホスティング サーバーにアップロードすると動作しません。
エラーが発生しました。COM コンポーネントへの呼び出しからエラー HRESULT E_FAIL が返されました。Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DataStoreNative.UpdateMetadata での System.Runtime.InteropServices.COMException (IntPtr ハンドル、オブジェクト行セット、文字列 dbstamp、UInt32& 変更) Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.Datastore.UpdateMetadata(Object) でMicrosoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.EndBackendCall(BackendCallData データ) の Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.RefreshCacheInternal(BackendCallData& データ) の Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal( ) Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Microsoft.TeamFoundation.Client.ITfsTeamProjectCollectionObject で。System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute (オブジェクト インスタンス、Object[] 引数) の System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c_ の DisplayClass13.b _c (オブジェクト インスタンス、Object[] methodParameters ) DisplayClass5.b _4() at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancelToken)
私のコード:
public void AddWorkItem(string title,string description,string imagePath) { string _myUri = "https://testredrock.visualstudio.com/DefaultCollection"; NetworkCredential netCred = new NetworkCredential(userName, password); BasicAuthCredential basicCred = new BasicAuthCredential(netCred); TfsClientCredentials credential = new TfsClientCredentials(basicCred); credential.AllowInteractive = false; string TFSServerPath = "https://testredrock.visualstudio.com/DefaultCollection"; using (TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(TFSServerPath), credential)) { CatalogNode catalogNode = tfs.CatalogNode; ReadOnlyCollection<CatalogNode> tpNodes = catalogNode.QueryChildren( new Guid[] { CatalogResourceTypes.TeamProject }, false, CatalogQueryOptions.None); WorkItemStore workItemStore = tfs.GetService<WorkItemStore>(); Project teamProject = workItemStore.Projects[project]; WorkItemType workItemType = teamProject.WorkItemTypes[workitemType]; // Create the work item. WorkItem userStory = new WorkItem(workItemType) { // The title is the only required field that does not have a default value. // You must set it, or you cannot save the work item. Title = title, Description = "", }; userStory.Fields["Repro Steps"].Value = description; // Save the new user story. userStory.Save(); } }