Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

VS2022 Mac can't build, claiming I have missing SDKs

I got a new Macbook for development and I’m now in the process of building the dev environment for it. I have installed .NET 6, 7, and 8 SDKs, then VS2022 and Rider (I mostly rely on Rider and VS2022 is more of a backup and a way to diagnose weirdness, like now).

So, I get some strange error with Rider when I build MAUI apps and wanted to try it with VS2022 to see if I get the same. Instead, turns out, VS2022 can’t build any of my projects. When I do I get this:

Error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0.  Either target .NET 7.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. (NETSDK1045) (TetraPak.XP.Common)

For troubleshooting I have made sure .NET 8 is indeed installed…

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

> dotnet --list-sdks
6.0.419 [/usr/local/share/dotnet/sdk]
7.0.313 [/usr/local/share/dotnet/sdk]
8.0.201 [/usr/local/share/dotnet/sdk]

printenv reveals a PATH to the .NET root folder at /usr/local/share/dotnet

I have made sure there is no global.json file or Directory.build.props anywhere that points to the wrong SDK

I tried point the environment variable export MSBuildSDKPath="/usr/local/share/dotnet/sdk"

I ensured VS2022 wasn’t building with MSBuild on Mono

I’m now out of ideas. Is there anything else I can do?

>Solution :

There’s no support for .NET 8. VS for Mac was discontinuted and goes out of support in August 2024.

As the announcement says:

Microsoft doesn’t plan to add support for .NET 8 or C#12 to Visual Studio for Mac. We won’t extend to any other workloads before retirement either.

The official alternatives are to either work on VS on Windows with a paired Mac, or use VS Code with C# Dev Kit, which requires a subscription similar to Visual Studio. From the docs

For personal, academic, and open-source projects, the C# Dev Kit can be used at no cost. For commercial purposes, teams of up to 5 can also use the C# Dev Kit at no cost. For 6+ developers, those users will need a Visual Studio Professional (or higher) subscription. The C# Dev Kit is also included in GitHub Codespaces and Microsoft Dev Box, so users of those products have access to the C# Dev Kit at no additional charge

You could use Parallels to run VS for ARM on Windows 11 for ARM on a Mac. I have no idea if this is a viable option though

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading