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
I also solved the problem in this way:
Check versions on dotnet sdk available
C:\Users\me>dotnet --list-sdks
##2.1.202 [C:\Program Files\dotnet\sdk]
##2.1.505 [C:\Program Files\dotnet\sdk]
##2.1.508 [C:\Program Files\dotnet\sdk]
##2.1.509 [C:\Program Files\dotnet\sdk]
##2.1.511 [C:\Program Files\dotnet\sdk]
##2.1.514 [C:\Program Files\dotnet\sdk]
##2.1.801 [C:\Program Files\dotnet\sdk]
I tested my build on all of those versions and it does not work until I uninstalled all of the above from Programs and Features. Then download from the latest:
https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.300-windows-x64-installer
This worked. Dont waste time like i did just install latest version of dotnet sdk and you good to go. "