Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2017RC Package Manager does not show correct packages after installing one & uninstalling another #4364

Closed
julielerman opened this issue Jan 23, 2017 · 9 comments
Assignees
Milestone

Comments

@julielerman
Copy link

julielerman commented Jan 23, 2017

I had a project that targetted Microsoft.EntityFrameworkCore.SqlServer. This was migrated from a VS2015 project.json solution.

I wanted it to use Sqlite instead.
If I were to start by uninstalling sqlserver, many packages that Sqlite needs would be removed and installing sqlite would have to get them again. So to be efficient, I installed Sqlite first

When it was finished I saw both packages listed in the Installed page of the package manager.

Then I uninstalled the SQL SErver package. When it finished it showed the SQLServer was installed but not SQLite.

I refreshed it using the refresh icon to the right of the search box. No change.

I opened up the csproj file and saw that the Sqlite package was listed, not the sqlserver package. (This is correct).
I closed and opened teh package manager but sql server was still there but SQLite was not.

I closed the solution and reopened it but SqlServer was still there but SQLite was not.
I closed VS and reopened. This time SQL Server was still there and csproj also had it. :(
I made the change in csproj, opened up package manager and it showed sqlite correctly.
Here is a screenshot while it was still out of sync.
image


Attempting to reproduce WITHOUT a migration
Create a new class library project.
Edit csproj.
Add

Save, Let it restore packages & build. Seems fine.
Open Nuget package manager. No filters .NET Core APp is there but not the EFCore package:

image

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): VS UI

NuGet version (x.x.x.xxx): 4.0.0 (I had to look in Help About to find this...no longer an extension?)

dotnet.exe --version (if appropriate): 1.0.0-rc3-004512

VS version (if appropriate): VS2017RC 15.0.0-RC.3

OS version (i.e. win10 v1607 (14393.321)):

Worked before? If so, with which NuGet version:

Detailed repro steps so we can see the same problem

[see above]

@rrelyea
Copy link
Contributor

rrelyea commented Jan 23, 2017

@zhili1208 - Can we repro? Regression from 3.5?

@zhili1208
Copy link
Contributor

zhili1208 commented Jan 23, 2017

@rrelyea I can't repro with d15prerel 26120.4, nuget version: 4.0.0.2215

@julielerman Could you check the nuget version by opening package manager console from Tools/NuGet Package Manager? it will show Package Manager Console Host Version from console. And also the VS build number form VS Help about. Thanks

@rrelyea
Copy link
Contributor

rrelyea commented Jan 27, 2017

Sounds like a dupe of #4035

when we do a package operation, we tell the project system. they make the change in the project.
when data changes in the project that nuget cares about, the project system needs to tell us.
they do.
however, our UI doesn't understand that data has changed.

Sounds like a dupe, right?

@zhili1208
Copy link
Contributor

For the second repro, Yes, sounds like a dupe.

but looks like first repro has two issues, first one is sqllite does not show up in UI (this should be "UI doesn't understand data has changed" ). the second one is sql server should not show in UI, since it's DotNetCliToolReference(not sure about this issue).

@julielerman
Copy link
Author

julielerman commented Jan 28, 2017

I now have RC3 installed and will retry try both scenarios

The second scenario (new project, add package ref in csproj) now works as expected. After package restore, I see the package I added in the Nuget Package manager.

Now off to go through the migration scenario.

@julielerman
Copy link
Author

The scenario where I installed sqlite then uninstalled sqlserver is better but not perfect yet.
After I uninstalled sqlserver from the package manager, it was still listed on the installed page. The first thing I did after that was EDIT the csproj. As soon as I opened that and then brought the package manager view forward again, sqlserver was gone from the package manager's installed list. So I'm guessing that if I had done any other type of action that caused Installed page to refresh, I would have seen sqlserver go away also. But it's disconcerting to still see it there after the uninstall has completed, the status shows packages restored, etc. But it's close now! :)

@julielerman
Copy link
Author

Out of curiosity, I then uninstalled the SQLite package and it was the same result. When all was said and done, it still showed on the installed page. I then went to the Browse page, then back to Installed and it was gone.

@rrelyea
Copy link
Contributor

rrelyea commented Jan 29, 2017

The problem I believe you are still seeing is #4035, which we are addressing as we speak.
If you click refresh in the Package Manager UI and it fixes itself, this is the same problem.

Because the package references are stored in the project file, we need to communicate with the project system. Due to the fact that the project system owns the data, and tells us when it is changed, we need to build some better change notification into our UI, so that when we are told the data has changed, we are able to update UI that is currently being shown.

Thanks for trying the latest RC!

@julielerman
Copy link
Author

excellent. then I believe it's safe to close this. thanks.

@rrelyea rrelyea added Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug labels Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants