have tried upgrading to the professional version of visual studio 2017 v 15.6.0 (Preview 7.0)
and installed aspnetcore-runtime-2.1.0-preview1-final-win-x64 and .net
Go to your pipeline. Click on Edit pipeline. Click on the Agent Specification dropdown. Change it to Windows 2019. Click Save And Queue.
And here you Go. It worked fine for me.