Hello All,
I am seeing the WorkItemFormControl form hanging while I initialize it with the following code:
new WorkItemFormControl();m_wifc =
m_wifc.Item = paramWI;
m_wifc.Dock = DockStyle.Fill;
m_wifc.Name = "WIFC";
When the .Item property is assigned, the control seems to hang and never return. Here is the callstack from the debugger:
[Managed to Native Transition]
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.dll!<Module>.CLocker.Enter() + 0x19 bytes
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.dll!Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.FieldClass.IsReadOnly.get() + 0x69 bytes
Microsoft.TeamFoundation.WorkItemTracking.Client.dll!Microsoft.TeamFoundation.WorkItemTracking.Client.Field.IsEditable.get() + 0x11c bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.FieldControl.ReadOnly.get() + 0x3e bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.FieldControl.ResetStyle() + 0x2c bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.FieldControl.Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.InvalidateDatasource() + 0x5c bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.ControlFactory.UpdateControls() + 0x72 bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.WorkItemFormControl.UpdateControls() + 0x7c bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.WorkItemFormControl.RenderView(bool force = false) + 0x209 bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.WorkItemFormControl.RenderView() + 0x1a bytes
Microsoft.TeamFoundation.WorkItemTracking.Controls.DLL!Microsoft.TeamFoundation.WorkItemTracking.Controls.WorkItemFormControl.Item.set(Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem value = {Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem}) + 0xa3 bytes
...
This seems to be VERY rare, but I have a work item on a test setup that causes this behavior every time I try to open it.
There are two questions for this... First, what is causing this hang And second, how can I work around this problem
Thanks for the help,
~Joe

WorkItemFormControl hanging on .Item assignment
Shabari
Also, if it helps, the WorkItem that I'm setting to .Item comes out of a WorkItemResultsGrid that was loaded using the LoadFromWiql() method.
-Ben
mrmckeb
I have the exact same problem, when I have one Work Item linked to two other ones, I can't change the WorkItemFormControl.Item while debugging without getting a hang.
It would be very nice if something could find us a work arround, because I can't really afford to not use the debugger.
Thanks,
Loic
Ronghwa
Thanks,
Chris
ebrian
Joe, it definitely looks like a bug. We use similar code to show workitemform in VS UI and I never heard of this hang problem. How did you manage to repro this consistently Can you give the steps & I can raise a bug on it. We use a static lock in our object model to simulate apartment threading in COM world, and the cause seems to be dead lock issue with UI thread blocked for ever. But without a repro, it is hard to guess what could have caused it.
Thanks.
CJW99
Unfortunately, I haven't found any other new way around it. The only way I've found is to alternate between linked and non-linked work items when in Debug.
-Ben
imranmp
GregDuck
Hi Naren,
Any thoughts on what to do in the meantime Is there any way to completely reset the state of the WorkItemFormControl and LinksControl between work item assignments I have a feeling that there are some "static" variables that are probably the cause of the problem.
Thanks,
-Ben
osamaT
I've narrowed it down further.
I edited my Bug work item template and (temporarily) commented out the Links tab and that got rid of the hangs.
The hang is definitely happening somewhere in the LinksControl.
-Ben
Steev
Naren,
I've got the same issue but what's unusual is that I didn't have this problem until this week.
It only happens while I'm debugging my application.
I can assign unlinked (nothing in the "Links" tab) work items without problems.
I can assign an unlinked work item, then a linked work item, and then an unlinked work item without problems.
If I assign two linked work items in a row, I get the hang.
-Ben
mark aoki
I simply gave up using that form in debug mode...
Once you have links it hangs your application, so try to avoid Work Items with links, or stay away from this control in debug!
Loic
dr.acv
ToutEnmasm
No, there isn't a way to export/import workitem. You can consider raising a bug and we can investigate based on the stack.
Link to raise bug: https://connect.microsoft.com/VisualStudio/feedback/ (Choose Visual Studio 2005 Team Foundation Server in the Version combo box)
DanielV
Naren,
Thanks for the quick follow up... A repro may be quite difficult since the only consistent repro seems to be on a particular work item on our test TFS server. Is there a way to 'copy' a work item and import it into another TFS server I could then dump the work item and send it to you.
~Joe