mrward / monodevelop-nuget-extensions

Extends the MonoDevelop NuGet addin
MIT License
72 stars 9 forks source link

Package Console Extension window stopped working in VS for Mac 7.8 #29

Closed ghost closed 5 years ago

ghost commented 5 years ago

I'm not able to use the extension window in Visual Studio 2017 for Mac 7.8. It had worked fine in 7.7.x and earlier. When I try to open it after updating to 7.8, irrespective of my solution, I get this content in the pad:

screen shot 2019-02-21 at 1 24 08 pm

There is no prompt for entering commands at that point, and the dropdown can't be selected to pick a source or project. You can see that the Package Source and Default Content dropdown are duplicated, which is a little weird!

I would expect it to look more like your sample image: your sample

ghost commented 5 years ago

I noticed this blurb in the IDE log:

ERROR [2019-02-21 13:51:22Z]: An unhandled exception has occurred. Terminating Visual Studio? False System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: VTable setup of type MonoDevelop.PackageManagement.ConsoleHostSolutionManager failed at ICSharpCode.PackageManagement.Scripting.PackageManagementConsoleHostProvider.CreateConsoleHost () [0x00001] in :0 at ICSharpCode.PackageManagement.Scripting.PackageManagementConsoleHostProvider.get_ConsoleHost () [0x0000f] in :0 at MonoDevelop.PackageManagement.PackageConsolePad.CreatePackageConsoleViewModel () [0x00007] in :0 at MonoDevelop.PackageManagement.PackageConsolePad.Initialize (MonoDevelop.Ide.Gui.IPadWindow window) [0x00010] in :0 at MonoDevelop.Ide.Gui.PadContent.Init (MonoDevelop.Ide.Gui.IPadWindow window) [0x00034] in /Users/vsts/agent/2.147.1/work/1/s/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs:69 at MonoDevelop.Ide.Codons.PadCodon.InitializePadContent (MonoDevelop.Ide.Gui.IPadWindow window) [0x0001c] in /Users/vsts/agent/2.147.1/work/1/s/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs:93 at MonoDevelop.Ide.Gui.DefaultWorkbench.CreatePadContent (System.Boolean force, MonoDevelop.Ide.Codons.PadCodon padCodon, MonoDevelop.Ide.Gui.PadWindow window, MonoDevelop.Components.Docking.DockItem item) [0x0000c] in /Users/vsts/agent/2.147.1/work/1/s/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:1460 at MonoDevelop.Ide.Gui.DefaultWorkbench+<>c__DisplayClass144_0.b__0 (System.Object , System.EventArgs ) [0x00000] in /Users/vsts/agent/2.147.1/work/1/s/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:1512 at MonoDevelop.Components.Docking.DockItem.SetupContent (System.Object ob, System.EventArgs args) [0x00026] in /Users/vsts/agent/2.147.1/work/1/s/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs:201 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004c] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:313 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e1] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/Delegate.cs:467 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/MulticastDelegate.cs:67 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/Delegate.cs:412 at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x0007f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/gtk-sharp-None/glib/Signal.cs:207 at GLib.Signal+SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00019] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/gtk-sharp-None/glib/SignalClosure.cs:114 at GLib.Signal+SignalClosure.MarshalCallback (System.IntPtr raw_closure, GLib.Value return_val, System.UInt32 n_param_vals, GLib.Value param_values, System.IntPtr invocation_hint, System.IntPtr marshal_data) [0x00053] in /Users/builder/

mrward commented 5 years ago

Thanks for letting me know. I thought version 0.15 was OK with VS Mac 7.8 but it seems that I changed the IMonoDevelopSolutionManager in VS Mac 7.8 and I think that is what is breaking the NuGet extensions addin.

Will look to publish a new build of the NuGet extensions addin today for VS Mac 7.8.

gkarabin commented 5 years ago

Thanks (@gjkhw here, personal account). As fate would have it, something funny was going on with the company firewall and my clone of this repo wouldn’t complete. I will start building some of your extensions locally when this stuff happens, if they aren’t too hard to bootstrap.

Your plugins are very much appreciated. Nobody on my team who uses a Mac does so without this plugin in particular - it is invaluable in our NuGet building flow. if you were ever looking for justification to roll it into MonoDevelip proper or VS for Mac, we would be pleased. I can imagine that there are good reasons not to do it, but since I’m not sure on the details, I’ll just say thanks for making the plugin.

mrward commented 5 years ago

Published version 0.16 which should work with Visual Studio for Mac 7.8. It is on the main addin gallery.

http://addins.monodevelop.com/Project/Index/121

Hopefully at some point being able to manage packages at the solution level will be integrated. Not sure about the PowerShell console. There is a separate branch where I am working on using PowerShell Core, remotely hosted, instead of Pash. Also adds tab completion in the console window. Possibly by using PowerShell Core we could get the console integrated in the main IDE.

ghost commented 5 years ago

Thanks - that seems to have done the trick.


For what it's worth, with your pash submodule, people who are stuck behind a firewall that block git protocol won't get it because your .gitmodules hardcodes the protocol. While I could clone your main repo using https, the attempt to clone pash fails. I was able to init the submodule manually using https, but it's a little awkward.

https://www.gniibe.org/memo/software/git/using-submodule.html implies that you can use a relative path to the submodule, so that the protocol will be whatever protocol was used for the main clone. https://git-scm.com/docs/git-submodule bears that out.

mrward commented 5 years ago

This has broken again in VS Mac 7.8.3 which updated to NuGet 4.8.3. The Manage Packages dialog is OK but the PowerShell console is not happy.

Could not set up parent class, due to: Could not load type of field 'NuGet.PackageManagement.PowerShellCmdlets.PackageActionBaseCmdlet:<DependencyVersion>k__BackingField' (8) due to: Could not load file or assembly 'NuGet.Resolver, Version=4.8.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. assembly:/Users/matt/Library/Application Support/VisualStudio/7.0/LocalInstall/Addins/MonoDevelop.PackageManagement.Extensions.0.16/MonoDevelop.PackageManagement.Cmdlets.dll type:PackageActionBaseCmdlet member:(null)
Command 'Invoke-UpdateWorkingDirectory' not found.
NuGet 4.8.2.0
Type 'get-help NuGet' for more information.

Command 'Invoke-InitializePackages' not found.
gkarabin commented 5 years ago

Thanks for the heads up! I’ll avoid the update for a bit.

mrward commented 5 years ago

Published version 0.17 which should be OK with VS Mac 7.8.3.

https://addins.monodevelop.com/Project/Index/121

SarahWuTX commented 5 years ago

I am using VS Mac 8.0.2(build 23) and NuGet 4.8.2.0 But version 0.17 doesn't work properly... Some commands are ok like 'Update-Package' while some are not, like 'Add-Migration'.

Error massage :

Command 'Get-Module' not found.
  +CategoryInfo: InvalidOperation, Reason: CommandNotFoundException
  +FullyQualifiedErrorId: PackageManagementInternalError
Parse error at (11:10): Syntax error, expected: (, $(, @(, {, @{, decimal_integer_literal, hexadecimal_integer_literal, r...
  +CategoryInfo: InvalidOperation, Reason: ParseException
  +FullyQualifiedErrorId: PackageManagementInternalError
mrward commented 5 years ago

The current version uses Pash which has incomplete support for PowerShell. Currently, apart from the standard NuGet package commands, such as install-package, update-package, other commands are not guaranteeed to work.

I have been working on a PowerShell core based console but this has not yet been released.