Search code examples
.netasp.net-mvcvisual-studio-mac

Visual Studio 2022 17.8 Preview 2 for Mac (m1) - with .NET core 8 support?


I would like to do some web development on my M1 mac machine, with ASP .NET core 8, but it seems like I am not able to find a Visual Studio version, that allows me to do so.

I was expecting to see a dropdown selection (for the target selection) with the .NET 8.0 (Preview) enter image description here

But instead I see, enter image description here

When I go to preferences, I can see that I have the .NET sdk 8 installed - enter image description here

EDIT: I even tried manually overriding the .csproj file, and setting the TargetFramework to net8.0, but the IDE doesn't seem to like it: enter image description here


Solution

  • You will need to opt-in to .NET 8 support in Visual Studio for Mac. You can do this by opening the Preferences dialog from the main menu, selecting Other - Preview Features, and then checking Use the .NET 8 SDK if installed option, and restarting Visual Studio for Mac.

    Preferences - Other - Preview Features

    Then you can create, open and build .NET 8 projects.

    New project dialog - .NET 8

    Note that this is a preview feature so you might find some things that do not work. Although ASP.NET Core projects should be fine.