.Net Multiple Projects in Solution. MSB1011

I’m trying to set up my first runner. It’s for a project that has a top level solution then a bunch of sub-projects. I have the runner working through getting the nuget dependencies then it fails with the following error

MSBuild : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.

I can’t seem to figure out how to point it to the top level solution and go from there to build all the sub-projects. Is anyone able to help me out with this? Here’s my .yml

EDIT: To note the NET_BUILD_PATH that’s in there was something I found elsewhere but it didn’t exactly say how to use it so it was a shot in the dark

Are you using dotnet core? If yes, then you can just specify dotnet build in the build stage. dotnet build implicitly calls dotnet restore so you dont need to call nuget restore.

build:
stage: build
script:
- dotnet build

I believe we are but doing this results in the same error of wanting me to specify the project/solution to build and I’m not sure how to do that

I needed to at solution_name.sln to the build line :man_facepalming:

@vergarm your dotnet build got me around another issue once I fixed my original so thank you for that!

1 Like