CICD Pipeline for dotnet core on Gitlab

My dotnet core solution file contains multiple project and I want to build only 1 project in the solution file. I am using this command

dotnet build Solution.sln /t:projectname

this command in working correctly on my local command line but not on Gitlab and its building all the projects inside the solution. How can I proceed ?

Does anyone even use this forum?