4
votes

Am working on ASP.Net Web Application and Azure DevOps CI&CD Pipelines through GitHub repository. In my project, I have used some third party references(.dll's) which are running finely in local. But when am trying to build application through build pipeline in Azure DevOps after checking my code into GitHub, then am getting errors in the build task regarding

The type or namespace name 'xxxx' could not be found(are you missing a using directive or an assembly reference)

This is happening due to build task is unable to recognize the third party reference .dll files at the time of building which is in my local path. Can you please suggest me to "How to build the third party references in Build task"

1
Does your build pipeline have nuget tasks included to retrieve your 3rd party dependency dlls? - Colin B
@Colin B Thank you for your reply. No, my build pipeline nuget task doesn't included to retrieve 3rd party dependency dlls - Mani
unless your dlls are checked into source control (not best practice) then the agent executing your build will never have access to these dlls. You'll need to either grab the dlls from a package manager (like nuget) or put them under version control so that the build agent can access these at build time. If you look at a new build in Azure DevOps (for a .NET Web App) you will see it includes the NuGet tasks to ensure the latest version of NuGet is on the build agent and that it pulls dependencies onto the build machine using NuGet. - Colin B
@Mani Have you managed to find solution for this? I am facing the same issue now. - Ajith

1 Answers

0
votes

You can have third party references in Azure devOps Artifacts & use Nuget restore to get packages using option "Feed to use" -> "Feed(s) I select here" radio button
sample