Visual Studio Code on Apple M1 chip and .NET Core 3.1
Asked Answered
O

1

6

Trying to set up my dev env on my mac machine with M1. Downloaded VSCode and all required SDKs.

I am able to run any project >=6.x (because MSFT has native SDK for ARM64), but struggling in running projects that target .NET Core 3.1 for instance.

Here is what I get as an error when I try to build\run:

Architecture: arm64
Framework: 'Microsoft.AspNetCore.App', version '3.1.0' (arm64)
.NET location: /usr/local/share/dotnet/

The following frameworks were found:
  6.0.7 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=3.1.0&arch=arm64&rid=osx.12-arm64

I have tried to run VSCode using rosseta to emulate Intel without any luck. Looks like omnisharp extension needs to be updated, but not sure what exactly to change.

Appreciate any help!

P.S. Everything works in Visual Studio, but not in vscode.

UPDATE

Adding path (/usr/local/share/dotnet/x64) to x64 in /etc/path makes the trick, but I don't like this kind of trick, let me know guys if you have an any better solution...

Occurrence answered 13/7, 2022 at 0:34 Comment(4)
I've had a similar problem with running SpeFlow tests from Rider - I couldn't find any way to install an Arm64 version of .Net Core 3.1, and had to resort to your solution. I agree it's clunky, but at least it works!Photolysis
I am also struggling with this issue, could you share more details, where exactly do we need to add this path?Gyrfalcon
@JamesLavery could you please help me out with this?Gyrfalcon
I needed to edit the file /etc/paths to add the line: /usr/local/share/dotnet/x64 Note that you may not see the /etc folder in Finder on the mac because it's hidden. To see hidden files/folders in Finder, press Shift-Cmd-1 The above key combination toggles hidden folder/file visibilityPhotolysis
P
0

Adding an answser here as well as a comment, as formatting in comments doesn't work...

I needed to edit the file

/etc/paths

to add the line:

/usr/local/share/dotnet/x64

Note that you may not see the /etc folder in Finder on the mac because it's hidden.

To see hidden files/folders in Finder, press Shift-Cmd-1

The above key combination toggles hidden folder/file visibility

Photolysis answered 29/11, 2022 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.