0
votes

I'm trying to put all my old solutions in VSTS, create a build definition and my own NuGet repository. In my project I referenced external public NuGet packages like iTextSharp. In VS2017 my solution builds fine, but in VSTS the following errors occur:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "itextsharp, Version=5.5.12.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Error CS0246: The type or namespace name 'iTextSharp' could not be found (are you missing a using directive or an assembly reference?)

There is my build definition

I'm trying to understand why it builds in VS2017 but not in VSTS

Thanks a lot!

1

1 Answers

1
votes

Since you need to restore the packages from your own NuGet repository, you need to specify the package source in configuration file (NuGet.config) and specify that configuration file in NuGet restore task.

Since it is working fine in VS2017, so I think you added the package source in configuration file, then you can add that file to source control and specify in NuGet restore task. (Select Feeds in my NuGet.config option in NuGet restore task and specify the file)