0
votes

I setup an internal NuGet server to host internal dll packages. The setup went smoothly. The spec and nupkg were created successfully. However, when I launch a test project and attempt to install it from Manage NuGet Packages it fails.

The internal package shows up under Manage NuGet Packages with an install button. I hit install but it does nothing. I check my references folder and saw nothing added.

If I check the Manage NuGet Packages at solution level, it has a green check mark indicate that it's installed but doesn't give me a Manage option to see which project it was installed to.

My issue is somewhat similar to this post below. The only difference is that I don't have sub folders for my library. I just have 1 dll and I'm putting the nupkg file directly under the Packages folder. NuGet package fails to install

I'm not sure what I did wrong. Any suggestions?

1
Sounds like the NuGet package you added was a solution only package. Is the package id shown in the solution's package.config file (in .nuget/packages.config)? Without seeing what is inside your .nupkg file it is hard to tell if it is a solution only package.Matt Ward
No, there isn't. This is what I have in the .nuget > packages.config <?xml version="1.0" encoding="utf-8"?> <packages> <package id="NuGet.CommandLine" version="2.8.2" /> </packages> I do have an id specified in my spec file though. I'm new to configuring internal NuGet. I didn't know there is a difference. I was following a tutorial and I thought the same nupkg can be installed at both levels (solution and project).NKD
A NuGet package cannot be installed at both levels. If NuGet.CommandLine is the package you installed then that is a solution level package. If you install another package, say NUnit, then it will be installed at the project level.Matt Ward
@MattWard Thanks for the hint. I went back and read the documentation again. I got it fixed. Basically I was looking at the documentation how to create internal packages and copy and paste it to the "packages" folder. The issue is that it's only a subset of the whole picture. I found good full documentation and was able to fix the issue. Thanks again for looking into this.NKD

1 Answers

0
votes

Thanks to @MattWard for mentioned that the package got installed at the solution level. I went back to the official documentation here: https://docs.nuget.org/create/creating-and-publishing-a-package to review the differences with creating solution level package vs project level package and most important of all is the nuget naming convention when creating packages (the lib, content, etc. folder). I re-package my dll again with the naming convention and it works!