✅ The current .NET SDK does not support targeting .NET 8.0. Either Target .NET 6.0 or lower
I am pretty new to C# and web app development with it. I do SQL database management as my day job. I saw that .NET 8 Blazor Web App was released today and I wanted to try it out! But unfortunately, when I spin up the template.... I get the error listed in the title. I've updated my Visual Studio 2022 IDE, and I've installed .NET 8 SDK. What can I do to resolve this issue? Thank you in advanced!
24 Replies
What does
dotnet --list-sdks
say from the command line?These are the ones I've got
Hmm. And you've installed VS 17.8?
Indeed, I've updated and did a restart on the machine as well
What exactly are the steps you're taking to create the project?
Then I hit Create and let it create
Lol, oops, forgot to hide the location so was pointless to hide the "project will be created in" lol, oh whale
But, just running the default setup basically
Does
dotnet build
from the command line work?
Other things to check: do you have a global.json
in or above the project folder that specifies a lower sdk version?Do I need to update that file to 8?
Yup
Or rather, 8.0.1?
Ok, lemme update that one moment
Or just delete it entirely
Ok, let me delete it and rebuild
What that file says is "for any invocation of
dotnet
under this folder, use the 6.0.0 SDK, rolling forward to the latest minor version of 6 if available"I see, so I've deleted the Global.Json
Now I am able to run the template app! 😛
Will I need to rebuild a global.json file again? Or it'll auto rebuild if it needs one?
You don't need one, I don't know why you had one
For most people, all that will do is cause pain
Could it be because I was using an old tutorial using ASP.Net Web Application (.NET Framework)?
Probably not
Hm, donno how I generated the .json file, lol
But, I have a note now to check that location if I get that error again to remove it all together.
.Net MAUI doesn't generate .json either right? Lol
I am planning on noodling around with that template as well, see what's new and all that good stuff
It shouldn't, but I wouldn't worry about it too much right now
If you have no more questions, feel free to $close the thread 🙂
Use the /close command to mark a forum thread as answered
Great thank you! I am going to close this thread, as it's sovled
I appreciate the help!!