0

I am working in an ASP.NET website (Website-A) code base which consumes an in-house NuGet package dependency.

Website-A consumes a pre-release of a NuGet dependency (Dependency-A). Opening Website-A and looking at "NuGet packages for solution" shows that Dependency-A is currently installed. Running "Restore NuGet packages" runs normally with no errors.

Rebuilding this .NET solution should result in a directory being created in one of the projects. (This directory will not be "included" in the project of Website-A, but the folder should be visible. I have clicked the "show all files" button.)

The issue is that this directory does not appear after rebuilding, nor after re-installing the dependency in NuGet package manager and then rebuilding.

We have discovered that if we manually delete the "packages" folder in the solution, and then "Restore NuGet packages", then rebuild the solution, the dependency will now create the directory like it should. It seems to need the "packages" folder to not exist in order to work like it should.

My question is: Is there something I am missing as far as a setting to automatically delete the packages folder? I would like to avoid having to manually delete this folder every time I need to update to a new pre-release of a NuGet package (we do a lot of this). I am using Visual Studio Enterprise 2017.

1
  • When developing locally, project reference is a better choice than nuget packages if you have both two projects in your machine. Commented Nov 15, 2019 at 5:47

1 Answer 1

1

My question is: Is there something I am missing as far as a setting to automatically delete the packages folder?

I'm afraid the answer is negative. AFAIK, VS doesn't have the option to delete the packages folder in Solution directory since it's not a normal way to do package update or package restore.

In addition: Do the pre-release packages have different names like packageName.1.2.0-beta1.nupkg,packageName.1.2.0-beta2.nupkg?

If your pre-release packages have different versions, and you update them using Update button in VS Package Manager UI, I think this strange issue you shouldn't encounter this issue. And if you have both projects in your local machine, it's not a good choice to develop locally with nuget packages...

Sign up to request clarification or add additional context in comments.

3 Comments

It is another developer developing the NuGet package, so I'm not able to do a project reference. We have an internal ProGet feed for pre-releases. The pre-release packages do have unique names. I don't update them using the Updates tab button (among the Browse/Installed/Updates/Consolidate tabs). I install the latest by selecting it among "Installed", and checking the projects to install it on (at the right).
I am not the only person who has had this issue. I saw it on another developer's machine. But today the issue went away. I am investigating whether this might be because of a hanging process / need to restart app / need to reboot issue.
Glad to know the issue goes away, if there's any update for it, feel free to let me know :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.