Being offline while attempting to modify TFS version control servers causes an error in Visual Studio 2017
Posted: (EET/GMT+2)
When working with Visual Studio's Team Explorer window while offline can cause unexpected errors, even if you are only working with local (LAN-based, on-premises) TFS (Team Foundation Server) connections.
In the Connect To A Project dialog box (opened through the Manage Connections command in Team Explorer), Visual Studio 2017 asks you to login with an online account. Of course, you need to be online to log in, but even if you just want to reference a local TFS server, you might run into the following error:
--------------------------- Microsoft Visual Studio --------------------------- We could not refresh the credentials for the account first.last@company.com The browser based authentication dialog failed to complete. Reason: The server or proxy was not found. at Microsoft.IdentityService.Clients.ActiveDirectory.Internal. WindowsFormsWebAuthenticationDialog.ShowBrowser() at Microsoft.IdentityService.Clients.ActiveDirectory.Internal. WindowsFormsWebAuthenticationDialog.OnAuthenticate() at Microsoft.IdentityService.Clients.ActiveDirectory.Internal. WindowsFormsWebAuthenticationDialogBase.AuthenticateAAD(Uri requestUri, Uri callbackUri) at Microsoft.IdentityService.Clients.ActiveDirectory.Internal. InteractiveWebUI.OnAuthenticate() at Microsoft.IdentityService.Clients.ActiveDirectory.Internal. WebUI.Authenticate(Uri requestUri, Uri callbackUri) at Microsoft.IdentityService.Clients.ActiveDirectory.Internal. WebUI.<>c__DisplayClass12_0.<AcquireAuthorizationAsync>b__0() at Microsoft.IdentityService.Clients.ActiveDirectory.Internal. WebUI.<AcquireAuthorizationAsync>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter. HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Developer.IdentityService.AccountProvider.AdalClientProxyCallback. <>c__DisplayClass16_1.<<AcquireAuthorizationAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter. HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Developer.IdentityService.AccountProvider. AdalClientProxyCallback.<AcquireAuthorizationAsync>d__16.MoveNext()
Of course, the easy fix is to get online, but even if this is not an option, you can simply ignore the error and continue. It seems more and more software expect that you are always online, but this isn't the case all the time for everybody. Luckily, you can solve the problem with a couple of clicks, but it would be even better if Visual Studio would know when you're adding a local server, and not attempt to access your online account if you are offline.
Hope this helps!