Problem adding / removing servers from the DomainProjectPicker control

I have an issue related to adding servers to the list of servers provided by the DomainProjectPicker control (Beta 3 Refresh). Basically, if you remove a server you cannot seem to re-add it during the run of the application that launches the control. You need to restart the application in order to add the server back...

Here are steps to reproduce it:

  1. create a WinForms app that shows the DomainProjectPicker control from a button handler or something like it
  2. make sure you have a valid server to connect to so that a server shows up in the top dropdown when the control loads
  3. when the DomainProjectPicker control pops up, click on the 'Servers...' button to the right of the top dropdown control
  4. the 'Add/Remove Team Foundation Server' dialog appears
  5. REMOVE the server that was originally selected in the dropdown by clicking the 'Remove' button
  6. Say 'Yes' to the prompt that verifies if you want to remove the server from the list
  7. click 'Close' on the ''Add/Remove Team Foundation Server' dialog
  8. click the 'Servers...' button again
  9. 'Add/Remove Team Foundation Server' dialog appears again
  10. click the 'Add...' button to add the server you just removed back to the list
  11. the 'Add Team Foundation Server' dialog pops up
  12. type in the relevant information for the server you want to add
  13. click 'OK'
  14. ERROR - you get the following dialog:

---------------------------
Microsoft Visual Studio
---------------------------
TF31003: Your user account does not have permission to connect to the Team Foundation Server [server name here]. Contact your Team Foundation Server administrator and request that the appropriate permission be added to your account.
---------------------------
OK  
---------------------------

If you restart the application, you can add the server without problem.

Is there any way around this



Answer this question

Problem adding / removing servers from the DomainProjectPicker control

  • Ragz

    I am unable to reproduce this bug. Would it be possible to send me the stack trace whenyou get this error

     


  • GabrielMartin

    Cappy,

    Thanks for the detailed repro steps. I am working on reproducing this problem and will let you know the progress soon.

    Thanks,

    Ravi


  • Zenubis

    I have reproduced the problem again - the original steps I provided lacked a critical detail. Here are the modified steps:

       1. create a WinForms app that shows the DomainProjectPicker control from a button handler or something like it
       2. make sure you have a valid server to connect to so that a server shows up in the top dropdown when the control loads
       3. make sure that you are connecting to a Workgroup-based server that you have NOT cached the credentials for (so that the UICredentialsProvider will pop up the Team Foundation Server 'Log In' dialog)
       4. run the app, and make the DomainProjectPicker control come up (however you coded it to)
       5. the 'Log In' dialog should show up
       6. Click 'Cancel' or close the dialog without authenticating
       7. the DomainProject Picker control pops up with the last server successfully connected to (but not currently authenticated against) - there should be NO Team Projects listed in the dialog below the server dropdown control
       8. click on the 'Servers...' button to the right of the top dropdown control
       9. the 'Add/Remove Team Foundation Server' dialog appears
      10. REMOVE the server that was originally selected in the dropdown by clicking the 'Remove' button
      11. Say 'Yes' to the prompt that verifies if you want to remove the server from the list
      12. click 'Close' on the ''Add/Remove Team Foundation Server' dialog
      13. the DomainProjectPicker control should now be completely empty
      14. click the 'Servers...' button again
      15. 'Add/Remove Team Foundation Server' dialog appears again
      16. click the 'Add...' button to add the server you just removed back to the list
      17. the 'Add Team Foundation Server' dialog pops up
      18. type in the relevant information for the server you want to add
      19. click 'OK'
      20. ERROR - you get the following dialog:

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    TF31003: Your user account does not have permission to connect to the Team Foundation Server [server name here]. Contact your Team Foundation Server administrator and request that the appropriate permission be added to your account.
    ---------------------------
    OK 
    ---------------------------
    Perhaps this is by design but it seems that I should be prompted to authenticate for the new server I just added and not get this error dialog instead. As I said before, you must restart the application in order to add the server back.

    I will put the call stack in another post: it appears that it is too long and the Forum server throws an error when I try to add it here...

  • dybarra

    I could not reproduce this issue. Are you sure that the server you added initially is accessible with out entering any password   Would it be possible to give me the stack trace when you got this error

     

     


  • SSIS - newbie

    Hello Cappy,

    Thank you very much for the detailed repro steps. They have been very helpful in reproducing your scenario.

    I am not able to reproduce this bug with the latest builds (post Dec CTP). These has been some work in the authentication area that might have fixed this scenario.

    I would like to make sure the following case works for you (or shows up as the same as above):

    1. As a local user on the client box (that does not have access to TFS server - the server could be workgroup or domain joined), please run your WinForms App.
    2. Click the button to launch the DomainProjectPicker.
    3. Click the servers button to launch "Add/Remove Server" dialog.
    4. Provide the server name.
    5. You should get the dialog asking for credentials. Hit cancel.
    6. Close all the dialogs - all the way until the original dialog.
    7. Click the button to launch Domain Project Picker and repeat steps through 5.

    You should be getting prompted for credentials again. These repro steps are very similar to what you have and they go through the same code path. Please let me know what your observations are. I would like to see if there is any bug hiding some where.

    Thanks,

    Ravi


  • Lan Lan

    I had to restart the server after a crash (not TFS's fault) and the problem is no longer occurring. If it does reappear I will be sure to submit the stack trace.

  • elledibbi

    Question: Should I expect to see an authentication dialog between steps 2 and 3 above I see one in my sample. If I Cancel this dialog, the problem appears and I get a DomainProjectPicker with only the server field filled in (no projects below it). If I authenticate to get to the DomainProjectPicker, I don't see the problem...
  • kdee

    Here is the call stack from the event when it occurs, per your request:

         [Managed to Native Transition]  
         System.Windows.Forms.dll!System.Windows.Forms.MessageBox.ShowCore(System.Windows.Forms.IWin32Window owner = {Microsoft.TeamFoundation.Proxy.AddDomainDialog}, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton, System.Windows.Forms.MessageBoxOptions options, bool showHelp) + 0x1f8 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window owner, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton) + 0x19 bytes  
         Microsoft.TeamFoundation.Client.dll!Microsoft.TeamFoundation.Client.UIHost.ShowMessageBox(System.Windows.Forms.IWin32Window parent, string text, string helpTopic, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton) + 0x94 bytes  
         Microsoft.TeamFoundation.dll!Microsoft.TeamFoundation.Proxy.AddDomainDialog._okButton_Click(object sender, System.EventArgs e) + 0x20d bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e) + 0x57 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.OnClick(System.EventArgs e) + 0x49 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.PerformClick() + 0x65 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Form.ProcessDialogKey(System.Windows.Forms.Keys keyData) + 0x75 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ProcessDialogKey(System.Windows.Forms.Keys keyData) + 0x13 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.TextBoxBase.ProcessDialogKey(System.Windows.Forms.Keys keyData) + 0x82 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.PreProcessMessage(ref System.Windows.Forms.Message msg) + 0xb9 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.PreProcessControlMessageInternal(System.Windows.Forms.Control target = {Text = Cannot evaluate expression because a native frame is on top of the call stack.}, ref System.Windows.Forms.Message msg = {System.Windows.Forms.Message}) + 0xdf bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(ref System.Windows.Forms.NativeMethods.MSG msg = {System.Windows.Forms.NativeMethods.MSG}) + 0x72 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(ref System.Windows.Forms.NativeMethods.MSG msg) + 0x5 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = 0x00000004, int pvLoopData = 0x00000000) + 0x2ce bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = 0x00000004, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.Application.ModalApplicationContext}) + 0x17d bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) + 0x4ee bytes  
         Microsoft.TeamFoundation.Client.dll!Microsoft.TeamFoundation.Client.UIHost.ShowModalDialog(System.Windows.Forms.Form form, System.Windows.Forms.IWin32Window parent) + 0xfd bytes  
         Microsoft.TeamFoundation.Client.dll!Microsoft.TeamFoundation.Client.BaseDialog.ShowDialog(System.Windows.Forms.IWin32Window parent) + 0x5 bytes  
         Microsoft.TeamFoundation.dll!Microsoft.TeamFoundation.Proxy.ManageTfsListInternal.addButton_Click(object sender, System.EventArgs e) + 0x56 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e) + 0x57 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.OnClick(System.EventArgs e) + 0x49 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs mevent = {X = 0x0000003a Y = 0x0000000b Button = Left}) + 0xc3 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0xf2 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x544 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ButtonBase.WndProc(ref System.Windows.Forms.Message m) + 0xce bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.WndProc(ref System.Windows.Forms.Message m) + 0x2b bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0xd6 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 0x00000202, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes  
         [Native to Managed Transition]  
         [Managed to Native Transition]  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = 0x00000004, int pvLoopData = 0x00000000) + 0x2ea bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = 0x00000004, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.Application.ModalApplicationContext}) + 0x17d bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) + 0x4ee bytes  
         Microsoft.TeamFoundation.Client.dll!Microsoft.TeamFoundation.Client.UIHost.ShowModalDialog(System.Windows.Forms.Form form, System.Windows.Forms.IWin32Window parent) + 0xfd bytes  
         Microsoft.TeamFoundation.Client.dll!Microsoft.TeamFoundation.Client.BaseDialog.ShowDialog(System.Windows.Forms.IWin32Window parent) + 0x5 bytes  
         Microsoft.TeamFoundation.dll!Microsoft.TeamFoundation.Proxy.DomainProjectPickerInternal.addDomain_Click(object sender, System.EventArgs e) + 0xa8 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e) + 0x57 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.OnClick(System.EventArgs e) + 0x49 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.WndProc(ref System.Windows.Forms.Message m) + 0x66 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0xd6 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 0x00002111, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes  
         [Native to Managed Transition]  
         [Managed to Native Transition]  
         System.Windows.Forms.dll!System.Windows.Forms.Control.SendMessage(int msg, System.IntPtr wparam, System.IntPtr lparam) + 0x3d bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ReflectMessageInternal(System.IntPtr hWnd, ref System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x3e bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WmCommand(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x30 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x256 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) + 0x45 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0xd6 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 0x00000111, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes  
         [Native to Managed Transition]  
         [Managed to Native Transition]  
         System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x94 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.DefWndProc(ref System.Windows.Forms.Message m) + 0xc bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message}, System.Windows.Forms.MouseButtons button = Left, int clicks = 0x00000001) + 0x1b0 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x544 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ButtonBase.WndProc(ref System.Windows.Forms.Message m) + 0x151 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Button.WndProc(ref System.Windows.Forms.Message m) + 0x2b bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0xd6 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 0x00000202, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes  
         [Native to Managed Transition]  
         [Managed to Native Transition]  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = 0x00000004, int pvLoopData = 0x00000000) + 0x2ea bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = 0x00000004, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.Application.ModalApplicationContext}) + 0x17d bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) + 0x4ee bytes  
         Microsoft.TeamFoundation.Client.dll!Microsoft.TeamFoundation.Client.UIHost.ShowModalDialog(System.Windows.Forms.Form form, System.Windows.Forms.IWin32Window parent) + 0xfd bytes  
         Microsoft.TeamFoundation.Client.dll!Microsoft.TeamFoundation.Client.BaseDialog.ShowDialog() + 0x25 bytes  
         Microsoft.TeamFoundation.dll!Microsoft.TeamFoundation.Proxy.DomainProjectPicker.ShowDialog() + 0xc bytes  
    >    Compuware.TestCode.dll!Compuware.TestCode.ChooseProject() Line 80 + 0x10 bytes    C#
         [Our internal code]ManagedWinFormClient.Form1.TestVSTSWorkItemToolStripMenuItem_Click(object sender = {System.Windows.Forms.ToolStripMenuItem}, System.EventArgs e = {System.EventArgs}) Line 73 + 0x8 bytes    C#
         System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.RaiseEvent(object key, System.EventArgs e) + 0x41 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ToolStripMenuItem.OnClick(System.EventArgs e) + 0x51 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.HandleClick(System.EventArgs e) + 0xc7 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.HandleMouseUp(System.Windows.Forms.MouseEventArgs e = {X = 0x0000004b Y = 0x00000008 Button = Left}) + 0x220 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.FireEventInteractive(System.EventArgs e, System.Windows.Forms.ToolStripItemEventType met) + 0x87 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.FireEvent(System.EventArgs e, System.Windows.Forms.ToolStripItemEventType met) + 0x122 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.OnMouseUp(System.Windows.Forms.MouseEventArgs mea) + 0xc7 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0xf2 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x544 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) + 0x45 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.ToolStrip.WndProc(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x71 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.MenuStrip.WndProc(ref System.Windows.Forms.Message m) + 0x7f bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0xd6 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 0x00000202, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes  
         [Native to Managed Transition]  
         [Managed to Native Transition]  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = 0xffffffff, int pvLoopData = 0x00000000) + 0x2ea bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = 0xffffffff, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x17d bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes  
         System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) + 0x2e bytes  
         ManagedWinFormClient.exe!ManagedWinFormClient.Program.Main() Line 17 + 0x1a bytes    C#



  • Problem adding / removing servers from the DomainProjectPicker control