You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a blocker for a feature in Xamarin that retargets nuget packages when migrating a project from "Classic" to the new "Unified" API (from MonoTouch target framework to Xamarin.iOS).
The text was updated successfully, but these errors were encountered:
Right now I have this problem. I am still analyzing the issue, but
IEnumerable GetInstalledPackages();
and
IEnumerable GetInstalledPackages(Project project)
return zero.
But "nuget restore" prints: "All packages are listed in packages.config are installed."
Btw. tested on Vs17.9.5, Vs17-preview and Vs19-preview
Supplement:
As I see in the sources the returned list will be zero in case the methods are called when the solution is not available... public IEnumerable<IVsPackageMetadata> GetInstalledPackages() { var packages = new HashSet<IVsPackageMetadata>(new VsPackageMetadataComparer()); return NuGetUIThreadHelper.JoinableTaskFactory.Run(async delegate { // Calls may occur in the template wizard before the solution is actually created, // in that case return no projects if (_solutionManager != null && !string.IsNullOrEmpty(_solutionManager.SolutionDirectory)) [[snip]]
The call of GetInstalledPackages() is done in a IProjectEvents event, named "AfterProjectFileOpened", which in turn "optionally requires" a solution file (in my context it is already their) but probably is not loaded before the "AfterProjectFileOpened"-event is fired. Strange...
Supplement 2:
My first thought in the previous notes looks correct.
Within the event handler dte2.Events.SolutionEvents.Opened += SolutionEvents_Opened; the list of packages is correctly returned; but a way to late in my current scenario...
@kzu,
Here's a repro xunit test for VS2015: http://cloud.cazzulino.com/NuGetTests.7z
May be related to #13.
This is a blocker for a feature in Xamarin that retargets nuget packages when migrating a project from "Classic" to the new "Unified" API (from MonoTouch target framework to Xamarin.iOS).
The text was updated successfully, but these errors were encountered: