mrward / monodevelop-nuget-extensions

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

Update for Visual Studio 2022 Preview #41

Closed MuhammadAliYousaf closed 2 years ago

MuhammadAliYousaf commented 2 years ago

It's not working on Visual Studio 2022 Preview. Version 17.0 Preview build 7303 Any update on that?

mrward commented 2 years ago

Not ported the extension to Visual Studio for Mac 17.0 yet.

The only extensions I have ported to 17.0 are available here - https://github.com/mrward/monodevelop-addins/tree/gh-pages/17.0

mrward commented 2 years ago

NuGet extensions 0.28 has been published for Visual Studio for Mac 17.0. It is available from the extensions manager in VS Mac or from the releases page - https://github.com/mrward/monodevelop-nuget-extensions/releases/tag/v0.28-vsm17.0

MuhammadAliYousaf commented 2 years ago

Thats great. Thanks.

But when I installed it I am getting following error.

Screenshot 2022-04-25 at 2 52 00 PM

Now, I did installed .NET Core version 3.1 runtime but you know its for x64 whereas I am using it on arm64. See my installed runtimes in the following images.

Installed sdks for x64.

Screenshot 2022-04-25 at 2 51 53 PM

Installed sdks for arm64.

Screenshot 2022-04-25 at 2 51 41 PM

Any help please.

mrward commented 2 years ago

Not done any testing on Arm64 since I do not have an Apple Silicon machine.

The addin uses the configured dotnet path and on Arm64 there is no .NET 3.1 arm64 runtime so this is going to fail.

https://github.com/mrward/monodevelop-nuget-extensions/blob/0e071f332f37b5384584d51d75bc4ea52b8de62f/src/MonoDevelop.PackageManagement.Extensions/MonoDevelop.PackageManagement.Scripting/RemotePowerShellHost.cs#L116

You can try configuring VS Mac to use the x64 dotnet in preferences - Build and debug - SDK Locations - .NET Core, however not sure that will work - VS Mac might start failing to build projects there.

Currently I am working on moving the PowerShell hosting so it is in process. Since VS Mac 17.0 runs on .NET 6 I can host PowerShell directly inside VS Mac instead of having a separate console host. In theory this should be another way to fix the problem - assuming the various PowerShell dylibs work OK on Arm64.

MuhammadAliYousaf commented 2 years ago

Can you please guide me how to configure VS Mac to use the x64 dotnet in preferences?

Also, waiting for the update in which you will host PowerShell directly inside VS Mac instead of having a separate console host.

Also, I have Mac M1 do let me know for any help. Thanks.

mrward commented 2 years ago

Preferences - Build and Debug - SDK Locations - .NET Core - .NET Core Command line. Path would be /usr/local/share/dotnet/x64/dotnet' - however I think this will break the build since VS Mac assumes this is an arm64 dotnet being used.

MuhammadAliYousaf commented 2 years ago

Awesome, it's working perfectly. Thank you.

Again, if you want to test anything on M1 please feel free to engage me. Thanks.

mrward commented 2 years ago

A new NuGet extensions version 0.29 has been published for VS Mac 17.0. Not sure how long it will take before it shows up in the extensions manager.

This new version hosts PowerShell in process, instead of using a separate console app.

Updated from PowerShell v6 to v7 which supports being run on Apple Silicon (M1) machines. Tested it on both Intel and M1.