Error NETSDK1100: Windows is required to build Windows desktop applications

I am building a dotnet core project. I tested the yml script on a test project and it worked fine but the same script is giving me this error on main project. I am using a windows system and I am specifying shell while registering gitlab runner. What can I do to resolve this?