Error NETSDK1013 the TargetFramework Was Not Recognized
Today’s error, this time in Rider:
Error NETSDK1013 : The TargetFramework value ’net7.0-ios’ was not recognized.
Migrating from Xamarin to MAUI has been quite adventure. And they always seem to run into problems whenever I’m switching from our Xamarin branch to MAUI branch. I don’t know if this has anything to do with the editor I’m currently using, which is Rider for work and VS Code for personal projects, but I’ll make sure to share the errors and the solutions on my blog.
Today’s lovely error was that the target framework could not be recognized, which made no sense since the moniker does exist (you confirm this in the documentation), And the SDK was installed.
dotnet --list-sdks
This will list the SDK’s you have installed. I did notice another error as well which wasn’t a part of the build errors, but rather was shown in the problems tab in the editor. Which said that ‘The current .NET SDK does not support targeting .NET 7.0.’ I tried building the solution from my terminal (not the one built in the editor) and the solution built just fine.
dotnet build
The problem was that the editor was defaulting to an older version of msbuild, and I honestly don’t know why since I haven’t used that version for almost a year, but thankfully this is easy to solve. Under settings do a search for Ms. build and you should be able to see the msbuild version and use the drop down to select the latest version which for me was 17. And with that the problem was solved.
Hope this solves the problem for you as well!
Comments
Last modified on 2024-01-24