Switch away from deprecated NuGet API#716
Conversation
|
|
||
| public static Guid GetProjectGuid(Project project) | ||
| { | ||
| string uniqueName = project.UniqueName; |
There was a problem hiding this comment.
Should we do some sort of return result checking in any of these? I'd assume there are HRs returned and object could be checked for null.
|
While doing some further testing with this, it seems really flaky. Now that the work of detecting package installation is async, it seems that the OleMenuCommand is not waiting for it to finish - it will use stale text for the menu command. I'm seeing this in the debugger where the context menu appears between stepping through these lines: I also tried moving the I tried caching the text to use, thinking I could make up for it, but that revealed that the NuGet API is actually pretty laggy. After executing an install/uninstall operation, it takes several seconds for it to return an updated result (which different from the old implementation, which seemed to update immediately). I'll need to follow up with someone from NuGet to understand why this API seems much flakier. |
The IVsPackageInstallerServices interface is marked deprecated for getting installed package info, due to threading problems within NuGet. Switched to the new interface instead.