Reference Project Package Registry From Another Project

I have one project that is just a library with it’s own gitlab yml file to create a nuget package on push. This works fine. I can reference that project registry locally in a consuming project, build it, and run it.

The consuming project is in gitlab as well, and I would like to setup a pipeline to build and deploy. I have done this before, but not with a project that consumes a package from another project’s registry.

I have put the “dotnet add source” in the yml file before the “dotnet publish”, and get confirmation that the source was created correctly in the logs, but get the following error: “error MSB4181: The “RestoreTask” task returned false but did not log an error” when it tries to restore the project.

From what I can tell, this is the last thing that happens during the build. I can’t recreate it locally on my own machine and changing the log verbosity doesn’t give me anything useful.

Surely this is a common scenario for solutions built across multiple projects, I want my library code separate from my api code, but I can’t seem to find anyone struggling similarly so maybe I am missing something.