Error Publishing .NET Core App in Azure DevOps YAML Build

Short story, I've created a simple YAML build for a .NET core project where one of the tasks publishes a simple .NET core console application. After running the build I got a strange error in the output:

No web project was found in the repository. Web projects are identified by presence of either a web.config file or wwwroot folder in the directory.