44A-RP
44A-RP

Reputation: 53

Azure Pipeline - C# Build project depending on another project in another repository

I have the following situation: On AzureDevops:

Project A - Repository A

Module3/Module3.csproj
Module1/Module1.csproj
Module2/Module2.csproj
Module1/Module1.csproj
- Solution.sln

Project B - Repository B

ModuleCore/ModuleCore.csproj
-ModuleCore.sln

ModuleCore is added to several projects.

In VisualStudio, when we are going to compile project A , I add ModuleCore.csproj as an existing project, and the compilation works.

I've done several pipelines on azure devops, with no dependency between projects, but with this one I'm having difficulty.

When I try to do the Build, it doesn't find the ModuleCore and breaks.

My current build task is:

 - task: VSBuild@1
      inputs:
        solution: '$(solution)'
        msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.ArtifactStagingDirectory)"'
        platform: '$(buildPlatform)'
        configuration: '$(buildConfiguration)'        

How do I build Project A and link Project B as a dependency? Is there any other way to perform this Build in the pipeline?

Upvotes: 1

Views: 267

Answers (1)

S Rao
S Rao

Reputation: 21

As Modulecore is being used in several projects, assuming it's a library it's best adding it to nuget (organisation level) repository and restore it while building the main solution.

Upvotes: 1

Related Questions