Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. public bool TryToConnect(string userName, string password, string tfsUrl)
  2. {
  3. var tpc = new TfsTeamProjectCollection(
  4. new Uri(tfsUrl),
  5. new NetworkCredential(userName, password, "pccin"));
  6.  
  7. try
  8. {
  9. tpc.EnsureAuthenticated();
  10. }
  11. catch (Exception)
  12. {
  13. return false;
  14. }
  15. return true;
  16. }
  17.  
  18. 2016-02-12T13:20:35 PID[25440] Verbose Error accessing the registry to get the display name: System.IO.IOException: The specified registry key does not exist.
  19. at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
  20. at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
  21. at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
  22. at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
  23. at Microsoft.TeamFoundation.Common.Internal.TeamFoundationEnvironment.**OpenOrCreateRootUserRegistryKey()**
  24. at Microsoft.TeamFoundation.Client.RegisteredTfsConnections.OpenCurrentUser(String key, Boolean writable, Boolean shouldCreate)
  25. at Microsoft.TeamFoundation.Client.RegisteredTfsConnections.GetInstancesInfos(Boolean includeDeleted)
  26. at Microsoft.TeamFoundation.Client.RegisteredTfsConnections.GetCollectionsInternal(Boolean returnOnlyLegacyServers)
  27. at Microsoft.TeamFoundation.Client.RegisteredTfsConnections.GetProjectCollection(Uri uri)
  28. at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.get_Name()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement