Search code examples
nugetazure-devopsazure-pipelinesazure-artifacts

Created a nuget package but when I reference it in my project I don't see it in the references


I've created a library project that holds various utility type functions that I need to reference in other projects. I've created a build in vsts and packaged and published to my internal company nuget feed. I can see the prerelease version that I pushed but when I reference it in my other projects I only see that it was added to the packages but I don't see any the references. Unsure what I'm doing wrong.

my .nuspec file looks like this. enter image description here


Solution

  • You need to put the assembly files to lib or runtimes folder, then these assemblies are added as references.

    More information: From a convention-based working directory.

    With VSTS build, you can pack the project file (csproj) through NuGet pack task directly. (Specify the project file path in Path to csproj or nuspec file(s) to pack input box), then the corresponding assemblies are added to lib folder, otherwise you need to do it by yourself with some tasks (e.g. Copy file)