c# - workitem.open() KeyNotFoundException TFS 2013 -
i'm stuck exception "the given key not present in dictionary" indicates value not found in dictionary, strange thing i'm not using dictionary, guess internal code of tfs api of c#. here part of code raising exception :
if (wi.validate().count == 0) { // save work item submit changes wi.save(); } else { console.writeline("following errors encountered when trying save work item {0} : ", id); foreach (var e in wi.validate()) { console.writeline(" - '{0} '", e); } } // close work item wi.close(); // submit changes database submitchangestodatabase(id, author, statuschanged, previouschangetime); // open again work item go on other updates wi.open();
this code part of loop, work item, perform updates using tfs api, after that, change read-only fields directly on database using method submitchangestodatabase. exception raised when invoking method open(). stack trace follows :
system.collections.generic.keynotfoundexception unhandled hresult=-2146232969 message=the given key not present in dictionary. source=mscorlib stacktrace: @ system.collections.generic.dictionary`2.get_item(tkey key) @ microsoft.teamfoundation.workitemtracking.internals.workitemhelper.findrevisionindexbydate(int32 tracktimefieldid, list`1 revisions, dictionary`2 latestdata, datetime dt, int32 startindex) @ microsoft.teamfoundation.workitemtracking.internals.workitemhelper.loadworkitemfielddata(irowsetcollectionhelper tables, iworkitemopenfielddatahelper helper) @ microsoft.teamfoundation.workitemtracking.client.workitem.loadworkitemfromrowsetinternal(int32 rev, nullable`1 asof, iworkitemrowsets witem) @ microsoft.teamfoundation.workitemtracking.client.workitem.loadworkitem(int32 id, int32 rev, nullable`1 asof) @ microsoft.teamfoundation.workitemtracking.client.workitem.open() @ csvtotfs.tfsserver.setworkitemhistory(int32 id, datatable ticketchange) in d:\documents\visual studio 2013\projects\tfs\csvtotfs\tfsserver.cs:line 253 @ csvtotfs.program.main(string[] args) in d:\documents\visual studio 2013\projects\tfs\csvtotfs\program.cs:line 173 @ system.appdomain._nexecuteassembly(runtimeassembly assembly, string[] args) @ system.appdomain.executeassembly(string assemblyfile, evidence assemblysecurity, string[] args) @ microsoft.visualstudio.hostingprocess.hostproc.runusersassembly() @ system.threading.threadhelper.threadstart_context(object state) @ system.threading.executioncontext.runinternal(executioncontext executioncontext, contextcallback callback, object state, boolean preservesyncctx) @ system.threading.executioncontext.run(executioncontext executioncontext, contextcallback callback, object state, boolean preservesyncctx) @ system.threading.executioncontext.run(executioncontext executioncontext, contextcallback callback, object state) @ system.threading.threadhelper.threadstart() innerexception:
i have had before when team project configured use team field instead of aeea path. if changed , of work items not yet have team specified error.
if create query "yourteamfield.team" set empty , bulk update of work items have value error should go away.
Comments
Post a Comment