Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps how to build project with references to another project in another solution

As the title says, my Solutions each contain Projects that rely on another Solution e.g.

Solution A

Project AA Project AB Project AC Solution B (Contains only a Class Library that has a folder that I put custom appsettings.json files in. This cannot be built on DevOps as it doesn't count as a project)

Project BA Solution AA and AC references BA. In the .csproj of Project AA and AC, theres a HintPath there showing the location of BA

When I compile on my local environment, everything is fine and it manages to compile and run properly.

I use GitHub as a repository and when I refer to it from Azure DevOps and try to build my Solution A, I get these errors:

D:\a_tool\dotnet\sdk\2.2.103\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "CentralApplicationSettings". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\ManagementStudio.ClassLibrary\ManagementStudio.ClassLibrary.csproj] D:\a_tool\dotnet\sdk\2.2.103\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "CentralApplicationSettings". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\ManagementStudio.Data\ManagementStudio.Data.csproj]

Its basically saying that it can't find the required references from GitHub and it makes sense because GitHub and DevOps doesn't have a similar folder structure so the HintPath won't make sense to the compiler.

I have been recommended to change Solution B to a NuGet package but the problem is, I will need to place my custom appsettings files there each time I deploy a new Solution so thats out of the question.

Is there another way I can build my Solution A on Azure DevOps without having to turn it into a NuGet package?

Solution A is like an Account Management application so I intend on deploying it alongside another more purpose built application.

EDIT:

Solution B has a folder where I put my custom appsettings.json files in a folder there so that the other deployed applications can access them. Its like an appsettings library.

If I make it a NuGet package, I am unable to copy the appsettings.json file there.

like image 384
JianYA Avatar asked Dec 07 '25 10:12

JianYA


1 Answers

Build another solution into packages and push those to nuget feed and use that feed when doing the restore on the second project

like image 99
4c74356b41 Avatar answered Dec 10 '25 00:12

4c74356b41