Error with VS 16.5.X "Project system data flow DataflowBlockSlim" - visual-studio-2019

Getting this error when building solution just after upgrading to VS 16.5.4. Nothing has changed on current machine.
Update to 16.5.5 and 16.6.2 did NOT solve the issue BUT 16.7 DID ! finally
Update ON 13/07/2020 : Apparently will be solve into 16.7 version hopefully
https://developercommunity.visualstudio.com/comments/1042100/view.html
How can i solve it ?
Information:
Microsoft Visual Studio Enterprise 2019
Version 16.5.4
VisualStudio.16.Release/16.5.4+30011.22
Microsoft .NET Framework
Version 4.8.03752
Installed Version: Enterprise
Architecture Diagrams and Analysis Tools 00435-60000-00000-AA704
Microsoft Architecture Diagrams and Analysis Tools
Visual C++ 2019 00435-60000-00000-AA704
Microsoft Visual C++ 2019
Add New File 3.5.138
The fastest and easiest way to add new files to any project - including files that start with a dot
ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools
ASA Service Provider 1.0
ASP.NET and Web Tools 2019 16.5.236.49856
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019 16.5.236.49856
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.5.236.49856
Azure App Service Tools v3.0.0
Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio 2.4.6000.1
Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools 16.5.236.49856
Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio 2.4.6000.1
Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
EditorConfig Language Service 1.17.284
Language service for .editorconfig files.
EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
File Nesting 2.6.85
Automatically nest files based on file name and enables developers to nest and unnest any file manually
GitHub.VisualStudio 2.11.96.24460
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.
Indent Guides 16
Indent Guides
Adds visual guides at each indentation level.
IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info
Markdown Editor 1.12.253
A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.
Microsoft Azure HDInsight Azure Node 2.4.6000.1
HDInsight Node under Azure Node
Microsoft Azure Hive Query Language Service 2.4.6000.1
Language service for Hive query
Microsoft Azure Stream Analytics Language Service 2.4.6000.1
Language service for Azure Stream Analytics
Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30207.1
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.1.25+gdacdb9b7a1
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
NuGet Package Manager 5.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Open Command Line 2.4.226
2.4.226
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
Snapshot Debugging Extension 1.0
Snapshot Debugging Visual Studio Extension Detailed Info
SQL Server Data Tools 16.0.62003.05170
Microsoft SQL Server Data Tools
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TSVN 1.9
Control TortoiseSVN from within Visual Studio
TypeScript Tools 16.0.20225.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.8.0.0 for F# 4.7 16.5.0-beta.20181.6+85af456066acd4e76d2bc7821b44a325e46f2fca
Microsoft Visual F# Tools 10.8.0.0 for F# 4.7
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Container Tools Extensions (Preview) 1.0
View, manage, and diagnose containers within Visual Studio.
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
Visual Studio Tools for Kubernetes 1.0
Visual Studio Tools for Kubernetes
System.AggregateException: Project system data flow 'DataflowBlockSlim (ActionBlockSlimAsync`1 : 19600903)' closed because of an exception: System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Unexpected false
at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition, String message)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProject.EndBatch()
at Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceProjectContextHost.WorkspaceProjectContextHostInstance.<ApplyProjectChangesUnderLockAsync>d__19.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.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.<>c__DisplayClass3_0.<<ExecuteAsync>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.VisualStudio.Threading.AwaitExtensions.ExecuteContinuationSynchronouslyAwaiter.GetResult()
at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.<ExecuteAsync>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.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedUnderLockAsync.<ExecuteUnderLockCoreAsync>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.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Unexpected false
at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition, String message)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProject.EndBatch()
at Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceProjectContextHost.WorkspaceProjectContextHostInstance.<ApplyProjectChangesUnderLockAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
--- 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.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedUnderLockAsync.<ExecuteUnderLockCoreAsync>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.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext()<---
. ---> System.InvalidOperationException: Unexpected false
at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition, String message)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProject.EndBatch()
at Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceProjectContextHost.WorkspaceProjectContextHostInstance.<ApplyProjectChangesUnderLockAsync>d__19.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.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.<>c__DisplayClass3_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedUnderLockAsync.<ExecuteUnderLockCoreAsync>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.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Unexpected false
at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition, String message)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProject.EndBatch()
at Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceProjectContextHost.WorkspaceProjectContextHostInstance.<ApplyProjectChangesUnderLockAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---

Not sure if this is your issues, but after looking around it looks like my previous MSBuild and related assemblies were registered in the GAC. Once I ran this in an elevated VS developer command prompt:
"gacutil /u Microsoft.Build.Framework"
All of my issues went away.
Got this solution from here:
https://developercommunity.visualstudio.com/content/problem/952614/after-update-from-vs-2019-1645-to-vs-2019-165-gett.html

There is an open ticket on M$ Developer community: https://developercommunity.visualstudio.com/content/problem/992414/project-system-data-flow-dataflowblockslim-actionb.html.

Release 16.7 of visual studio fixed the issue

Related

How to run Docker Desktop with Windows Containers on Amazon AWS EC2 Windows (or is this not possible)?

I have a DESKTOP machine running Windows 10 running Windows 10, Microsoft 365, Docker Desktop running in Windows Containers mode.
I have an Amazon EC2 machine running Windows Server 2019 and have installed Microsoft 365 on there too and access via RDP.
Essentially what I'd like to is create an EC2 machine which allows me to run Microsoft 365 AND Docker Desktop running in Windows Containers mode.
I've tried creating AWS EC2 instance and installing Docker for Desktop but I get lots of cryptic errors. (see below).
I tried using this AMI from Microsoft with Hyper-V built in https://aws.amazon.com/marketplace/server/procurement?productId=d94e0325-6111-4c69-8c29-87e784a6d0aa
[Or should I be using Docker Enterprise for this?]
[Or is it not possible to get a Windows machine which will run Docker Windows Containers on AWS at all?]
[Or do I need to choose a specific type of machine size [t4.large or whatever] - I have experienced on Microsoft Azure before that running Docker Desktop was possible only on machines of a certain spec, which allowed "virtualization on top of virtualization"]
System.InvalidOperationException:
job failed with message: 'DockerDesktopVM' failed to start. (Virtual machine ID 677B7F36-8A44-42CE-AD29-7884DDCE164C)
The Virtual Machine Management Service failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running (Virtual machine ID 677B7F36-8A44-42CE-AD29-7884DDCE164C).
at Docker.Backend.HyperVInfrastructure.HandleUpdatedJob(CIMConcreteJob updatedJob) in C:\workspaces\PR-15633\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 762
at Docker.Backend.HyperVInfrastructure.<HandleMaybeAsyncJob>d__38.MoveNext() in C:\workspaces\PR-15633\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 696
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.Backend.HyperVInfrastructure.<StartVMAsync>d__30.MoveNext() in C:\workspaces\PR-15633\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 544
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HyperV.<StartAsync>d__6.MoveNext() in C:\workspaces\PR-15633\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperV.cs:line 99
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HttpAPI.HyperVController.<StartAsync>d__7.MoveNext() in C:\workspaces\PR-15633\src\github.com\docker\pinata\win\src\Docker.Backend\HttpAPI\HyperVController.cs:line 42
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()
Update 2022
You can now install WSL (Windows Subsystem for Linux) on Windows Server 2019/2022 OS
https://learn.microsoft.com/en-us/windows/wsl/install-on-server
Docker Desktop is not supported on Windows Server 2019 OS host, Docker Desktop is only supported on Windows 10 host, Mac and planned for Linux Desktop ( there are kernel difference b/w Windows server host and Windows 10 desktop)
With Windows Server 2019 you can install Docker Engine Enterprise (now known as Mirantis Container Runtime (MCR) ) and run windows containers.
Following documentation from Microsoft has information on installing Docker Engine on Windows Server :
https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server
If you want to install via script checkout this link (Docker Engine Enterprise now known as Mirantis Container Runtime):
https://docs.mirantis.com/containers/v3.1/mcr-deployment-guide/mcr-windows.html
You can also checkout this blog here and follow the steps to install Docker Engine on Windows Server host :
https://mechdeveloper.medium.com/windows-server-2016-containers-bc0baa2222c1

Right click publish custom docker images to existing ACR with Visual Studio 2019

I get below error when I try to publish DotNet 3.1 web app via Visual Studio 2019 to ACR.
I followed this link's instructions to publish but instead of creating new one, I selected existing ACR from list. I also looked in Visual studio to set ACR credentials with any special switches shown in the error, but could not find it.
My Docker Desktop is of version - 2.5.0.1 and VS version is - 16.7.6
Getting below error:
Publish has encountered an error.
Running the docker.exe login command failed.
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
A diagnostic log has been written to the following location:
C:\Users\Admin\AppData\Local\Temp\tmp2719.tmp
Below is full stack trace file which was provided by Visual Studio after failing:
26-11-2020 08:40:30 PM
Microsoft.WebTools.Azure.Publish.Docker.DockerCommandException:
Running the docker.exe login command failed.
WARNING! Using --password via the CLI is insecure. Use
--password-stdin. at Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.ThrowDockerCommandError(String
dockerCommand) at
Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.d__5.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.WebTools.Azure.Publish.Docker.DockerPublish.d__2.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.WebTools.Azure.Publish.ContainerRegistry.ManageContainerRegistry.d__11.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.WebTools.Azure.Publish.PublishProviders.ContainerRegistryProfileVisual.d__32.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.Publish.Framework.ViewModel.ProfileSelectorViewModel.d__180.MoveNext()
According to the message you provided, it shows the docker login failed. As I know when you log in to the Visual Studio, then you can select the Docker support and publish the image to the existing Azure Container Registry if you have the permission to control the ACR. There is no option to set the credential for the ACR. But it gives the login failed error. So the possible reason is that your existing ACR does not enable the admin user. Try to enable the admin user for the ACR and then try to publish again.

TFS 2017 agent error (lost communication with the server)

I have TFS2017 installed on Windows Server 2008 R2 virtual machine. Yes, it's a weird combination, but it is what it is.
Also I installed agent(vsts-agent-win7-x64-2.117.2) on the same virtual machine. Agent is successfully installed as a service, it's up and running, I can see it in Default pool(showing as Online, Idle).
The problem starts when I request new build. It's always failing with error:
The agent agent3 lost communication with the server. Verify the machine is running and has a healthy network connection. For more information, see: https://go.microsoft.com/fwlink/?linkid=846610
I also checked logs in _diag folder:
[2018-02-27 09:33:48Z INFO JobDispatcher] Retrying lock renewal for jobrequest 9. Job is still locked for: 10 seconds.
[2018-02-27 09:33:58Z ERR JobDispatcher] Catch exception during renew agent jobrequest 9.
[2018-02-27 09:33:58Z ERR JobDispatcher] Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Not Found
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__48.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__451.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__271.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__261.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Listener.JobDispatcher.d__12.MoveNext()
[2018-02-27 09:33:58Z INFO JobDispatcher] Lock renewal has run out of retry, stop renew lock for jobrequest 9.
[2018-02-27 09:33:58Z INFO JobDispatcher] Unable to renew job request for job 88ba8e32-bdca-402c-8a94-d1e39f95819b for the first time, stop dispatching job to worker.
Seems that agent can't update item in job queue for some reason.
I checked firewall - it's off, and moreover TFS and agent are installed on the same machine.
Any ideas?
Update.
Screenshot of Services:
I tried to create different agents running under different users - NETWORK Service or current user, which is logged into TFS. Also I always check that service is started.
Update 2.
I tried to install another agent on another VM in the same network. It was installed and appeared in Default pool. But when it goes to build, same error occurs. Btw, another VM works under Windows Server R2.
Wow,
That was a real nightmare. But it's finally solved.
The root of the issue is a tool called UrlScan. It was installed on the server and by default it blocks all http verbs except GET/POST/OPTIONS.
Enabling all known verbs didn't help, because seems that Agent use some custom http header. The only way was to uninstall UrlScan completely.
Good luck.

TFS 2017 server required firewall settings for Build agent

I have TFS 2017 on Windows Server 2016 Standard.
I am now setting up Build agent on Windows 10 pro using PAT token authentication. (having "Agent Pools (read, manage)", "Agent Pools (read)", "Build (read"), "Code (read)", "Build (read and execute)", though this part seeems to be fine.
I am getting close to the very end of the configuration
Testing agent connection.
An error occured while sending the request.
Log file says
[2017-06-27 14:58:18Z ERR Agent] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: Der Servername oder die Serveradresse konnte nicht verarbeitet werden
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.WinHttpHandler.d__101.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.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 System.Net.Http.HttpClient.d__58.MoveNext()
More by chance (since this is nowhere mentioned as required) I disabled the firewall on the server and now the connection and configuration of the build agent goes to the very end.
I definitely have 443 and 80 open, I am using TFS via https/443 and also entered that in the build agent config. In the TFS console, I see :80 and :443, nothing like :8080.
What else do I need to consider?
TFS server is in a domain, build agent is not, https certificate is self-signed and added to Root CAs on build agent.
After opening all TCP ports outgoing and incoming and doing some "netstat -a", I also tried UDP.
After some testing and "binary search", I opened UDP 1434 and now the
Testing agent connection
results in asking for the _work folder.
Update:
After ~ 5 builds I got "An error occured while sending the request.. retry every 15 seconds..", looks like opening 5353 and 5355 UDP fixes this for now.

Azure web role not starting

I have a web role that will not start up when I deploy to Azure. Does anyone have any advice on the following windows event log...
Application: CacheDumpGenerator.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.SEHException
Stack:
at <Module>.RdGetLocalResource(UInt16*, _RD_RESOURCE**)
at <Module>._LOCALRESOURCE.GetLocalResourceW(UInt16*, _LOCALRESOURCE**)
at Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetLocalResource(System.String, Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropLocalResource ByRef)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource(System.String)
at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.GetLocalStoreDirectory()
at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.InitializeTraceProvider()
at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.get_TraceProvider()
at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.WriteLog(System.String, System.Diagnostics.TraceEventType, System.String)
at Microsoft.ApplicationServer.Caching.CacheDumpGenerator.ProcessDump.Main(System.String[])
I've just upgraded the web role to MVC4 from MVC3 which had worked fine. The application runs fine locally. I have just upgraded Microsoft.WindowsAzure.Configuration v2.
If you can establish a remote desktop connection with the machine, then do that and, rather than just looking in the Event Viewer, open up IIS Manager and browse to your website.
For me, this will often show an ASP.NET yellow screen error identifying any required files that have not been included within your deployed Azure package. You should mark those files as "Copy Local=true" and redeploy - you may need to do this a number of times to catch all of the missing files.

Resources