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

Upgrade to .NET 6 when released (for Mac M1/arm64 compatibility) #1403

Closed
xhale opened this issue Nov 5, 2021 · 13 comments
Closed

Upgrade to .NET 6 when released (for Mac M1/arm64 compatibility) #1403

xhale opened this issue Nov 5, 2021 · 13 comments
Assignees
Milestone

Comments

@xhale
Copy link

xhale commented Nov 5, 2021

Anything I can do at the moment to run the extension on Apple Silicon using the macOS arm64 RC2 build of .NET6?

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '3.1.0' (arm64) was not found.
  - The following frameworks were found:
      6.0.0-rc.2.21480.5 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.
@ghost ghost added the triage label Nov 5, 2021
@StephenWeatherford
Copy link
Contributor

@xhale

My understanding (could be wrong) was that M1 was supposed to have compatibility through a transition layer.

But from the output I was suspect you have the following vscode setting set to point to an SDK installation?

azureResourceManagerTools.languageServer.dotnetExePath

If so, please delete its value and try again. It should download .net to a private folder in vscode.

@xhale
Copy link
Author

xhale commented Nov 6, 2021

azureResourceManagerTools.languageServer.dotnetExePath was not set
dotnetAcquisitionExtension.existingDotnetPath was set to /usr/local/share/dotnet/dotnet

I then installed .NET Core 3.1 (x64 only) manually which really upset things! Removing both versions, then removing and reinstalling the extension results in "The path returned for .net core does not exist: /usr/local/share/dotnet/dotnet" which is what caused me to install .NET 6 arm64 RC initially.

Looks like I might actually have encountered the same as this issued reported against the .NET VSCode helper dotnet/vscode-dotnet-runtime#330 - namely that .NET Core 3.1 x64 doesn't seem to run on an arm64 Mac even with the Rosetta translation engine installed dotnet/runtime#44897

Looks like the resolution will need to wait until .NET 6 arm64 is final?

@pszypowicz
Copy link

pszypowicz commented Nov 8, 2021

When I tried to run this app on apple silicone m1 arm, I got this error:

(I'm copying all the errors to make it easier for other people to search this issue and provide them workaround)

This extension requires .NET Core for full functionality, but we were unable to download and install a local copy for the extension. If this error persists, please see https://aka.ms/vscode-armtools-dotnet for troubleshooting tips. 
Details: dotnet.acquire failed
See '.NET Runtime' in the output window for more information.

(Plugin tries to download a mac arm version - which does not exists for .net 3.x)

and

An error occurred while installing .NET (3.1): .NET Acquisition Failed: Installation failed: Error: Command failed: "/Users/pszypowicz/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.3.0/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/pszypowicz/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.20" -Version 3.1.20 -Runtime dotnet
dotnet_install: Error: Could not find `.NET Core Runtime` with version = 3.1.20
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support

As we saw the error: dotnet version 3.1.20 is required to be installed and unfortunately, this version is not compiled natively for arm mac processor. Although it will/may run on Rosseta 2 (which is a mac intel emulation).

To solve it, first lets do a cleanup. I used this official script:
https://raw.githubusercontent.com/dotnet/sdk/main/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh

then install .net 3 runtime version from here:
https://dotnet.microsoft.com/download/dotnet

Finally you have to configure your vscode JSON settings, and add following line:

"azureResourceManagerTools.languageServer.dotnetExePath": "/usr/local/share/dotnet/dotnet"

The first version of .net runtime which will support natively mac arm CPU will be 6. Maybe you could update your plugin to use it? Then 'VSCode extension for acquiring .NET Core Tooling' would download correct version.

@StephenWeatherford StephenWeatherford changed the title .NET 6 arm64 compatibility? Upgrade to .NET 6 when released (for arm64 compatibility) Nov 9, 2021
@StephenWeatherford StephenWeatherford added this to the 0.15.5 milestone Nov 9, 2021
@StephenWeatherford
Copy link
Contributor

@xhale Looks like it. We'll switch when we can.

@bhsubra FYI. Hopefully switching to .NET 6 won't be a problem with your current work...

@StephenWeatherford StephenWeatherford changed the title Upgrade to .NET 6 when released (for arm64 compatibility) Upgrade to .NET 6 when released (for Mac M1/arm64 compatibility) Nov 9, 2021
@pszypowicz
Copy link

.NET 6 was release yesterday and it is a LTS version.

https://dotnet.microsoft.com/platform/support/policy/dotnet-core

@StephenWeatherford
Copy link
Contributor

We ran into technical issues getting this to work. It will probably be after the holidays before we can get to it seriously.

@radoslawcz
Copy link

any news on this?

@StephenWeatherford
Copy link
Contributor

@bhsubra has been working on this. Are you interested in verifying a new build for us? She's OOF today but could hook you up next week.

@radoslawcz
Copy link

Yes, I have a macbook with m1 and can try to test the new build.

@bhsubra
Copy link
Contributor

bhsubra commented Jan 24, 2022

Yes, I have a macbook with m1 and can try to test the new build.

@radoslawcz , could you please try the attached vsix and let us know if the issue still persists? Thanks!

azurerm-vscode-tools-0.15.5.zip

cc: @StephenWeatherford

@radoslawcz
Copy link

radoslawcz commented Jan 24, 2022

@bhsubra

I just tested the plugin and it works properly. ARM Template Language Server starts using dotnet 6 - previously it tried to load dotnet 3 and failed.

Using dotnet core executable at /Users/radek/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.1/dotnet
Starting ARM Template Language Server at /Users/radek/.vscode/extensions/msazurermtools.azurerm-vscode-tools-0.15.5/languageServer/Microsoft.ArmLanguageServer.dll
Language server nuget version: 3.0.0-preview.22069.1

I loaded some ARM template and resources were recognized and were clickable in the ARM template outline. I didn't experience any errors.

@StephenWeatherford
Copy link
Contributor

@radoslawcz Thanks! We will release this soon.

@bhsubra
Copy link
Contributor

bhsubra commented Jan 26, 2022

@bhsubra

I just tested the plugin and it works properly. ARM Template Language Server starts using dotnet 6 - previously it tried to load dotnet 3 and failed.

Using dotnet core executable at /Users/radek/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/6.0.1/dotnet Starting ARM Template Language Server at /Users/radek/.vscode/extensions/msazurermtools.azurerm-vscode-tools-0.15.5/languageServer/Microsoft.ArmLanguageServer.dll Language server nuget version: 3.0.0-preview.22069.1

I loaded some ARM template and resources were recognized and were clickable in the ARM template outline. I didn't experience any errors.

@radoslawcz , thank you!

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

5 participants