1

Can't connect to VSTS - Got Sequence contains no matching element

An unhandled exception occurred while processing the request.

InvalidOperationException: Sequence contains no matching element

Single

  • InvalidOperationException: Sequence contains no matching element

    • Single

    • MoveNext in TfsAdapterBase.cs

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • GetResult

    • MoveNext in TfsAdapterBase.cs

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • GetResult

    • MoveNext in TfsAdapterBase.cs

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • GetResult

    • MoveNext in MultiVersionTfsAdapter.cs

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • GetResult

    • MoveNext in BuildSystemAdapterBase.cs

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • GetResult

    • MoveNext in BuildsController.cs

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • ValidateEnd

    • MoveNext

    • MoveNext

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • MoveNext

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • MoveNext

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • MoveNext

    • ThrowForNonSuccess

    • HandleNonSuccessAndDebuggerNotification

    • MoveNext


  • System.InvalidOperationException: Sequence contains no matching element
       at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
       at Web.Services.Tfs.TfsAdapterBase.<GetVsoAccountId>d__43.MoveNext() in C:\Build\2\_work\2\s\Desktop\LocalWeb\Services\Tfs\TfsAdapterBase.cs:line 280
    --- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Web.Services.Tfs.TfsAdapterBase.<EnsureInstanceIdAndUserLoaded>d__19.MoveNext() in C:\Build\2\_work\2\s\Desktop\LocalWeb\Services\Tfs\TfsAdapterBase.cs:line 172
    --- 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 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
       at Web.Services.Tfs.TfsAdapterBase.<GetAllBuildDefintions>d__8.MoveNext() in C:\Build\2\_work\2\s\Desktop\LocalWeb\Services\Tfs\TfsAdapterBase.cs:line 73
    --- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Web.Services.Tfs.MultiVersionTfsAdapter.<GetAllBuildDefintions>d__10.MoveNext() in C:\Build\2\_work\2\s\Desktop\LocalWeb\Services\Tfs\MultiVersionTfsAdapter.cs:line 75
    --- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Web.Services.Builds.BuildSystemAdapterBase`3.<Web-Services-Builds-IBuildSystemAdapter-GetAllBuildDefintions>d__22.MoveNext() in C:\Build\2\_work\2\s\Desktop\LocalWeb\Services\Builds\BuildSystemAdapterBase.cs:line 61
    --- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Web.Controllers.BuildsController.<EditBuildSettings>d__7.MoveNext() in C:\Build\2\_work\2\s\Desktop\LocalWeb\Controllers\BuildsController.cs:line 88
    --- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionFilterAsync>d__28.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__18.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.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.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.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.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.AspNetCore.Diagnostics.StatusCodePagesMiddleware.<Invoke>d__3.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.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__6.MoveNext()
    

1 reply

Hi Neil,

The app cannot get your user id from VSTS. Do you connect with Microsoft credentials, approving application in VSTS, or do you provide a username with password directly in the app?

If you approve application in VSTS in browser, make sure that user that is logged in that browser has access to some VSTS projects.