C
C#2y ago
Sven

✅ The current .NET SDK does not support targeting .NET 7.0

No description
59 Replies
Sven
SvenOP2y ago
I've installed .NET 7.0 already
Angius
Angius2y ago
Framework version should not have a v net7 net8 And so on
Sven
SvenOP2y ago
Where do you see that and how to fix it?
Angius
Angius2y ago
Ah, wait, you have <TargetFrameworkVersion> not <TargetFramework>, huh
Sven
SvenOP2y ago
Idk this is automatically generated
Angius
Angius2y ago
By?
Sven
SvenOP2y ago
I'm working with a friend of mine but everytime I work with someone I get this error. While I already have .net 7.0 installed. Only if I start the solution we can both work but that is not the case Seeing at the Analyzers in the Game/Reader project it analyzes the .net 6.0 version Maybe that is the problem but I don't know how I can make it analyze my .net 7.0 path Any idea how to fix?
Angius
Angius2y ago
What is it, exactly? A Unity game project? What generated this .csproj file?
Sven
SvenOP2y ago
No a console c# project .net core
Sven
SvenOP2y ago
No description
Angius
Angius2y ago
That... should not have created a .csproj that looks like this
Sven
SvenOP2y ago
Weird. He is also working with VS 2022 just like me. Also with the same version
Sven
SvenOP2y ago
so basically this line should be replaced?
No description
Angius
Angius2y ago
Did he create a Console App or Console App (.NET Framework)? also, can you post the whole csproj? $paste
MODiX
MODiX2y ago
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
Angius
Angius2y ago
Here for example
Sven
SvenOP2y ago
Just console app
Sven
SvenOP2y ago
Angius
Angius2y ago
Yeah I have no idea what it is This looks nothing like a console app csproj
Sven
SvenOP2y ago
So strange
Angius
Angius2y ago
No description
Angius
Angius2y ago
This is how a csproj of a console app looks Oh, I just noticed, your csproj mentiones MSBuild from 2003 This is absolutely not a .NET or .NET Core app This is .NET Framework 4.6 or so
Sven
SvenOP2y ago
Strange
Sven
SvenOP2y ago
do you know why .NET 7.0 is not in this list? It's so strange. I just downloaded + restarted my computer with SDK AND Runtime .NET 7.0
No description
Angius
Angius2y ago
Do you happen to have globals.json somewhere in this project?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2y ago
* Open powershell in a terminal in admin mode as in the following video: https://cdn.discordapp.com/attachments/569261465463160900/1157744344183341156/20230930-1822-10.7436061.mp4 * copy/paste the following script * it will tell you if it detects invalid Path setup * Press Enter to confirm
$OldSysPath=[System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine); `
$Hasx86=($OldSysPath.Split(';') | ? { $_.StartsWith('C:\Program Files (x86)\dotnet')}).Count -gt 0; `
if ($Hasx86) {
Write-Host "**********************************************************************"; `
Write-Host "If you're seing this message your SYS PATH is improperly set" -ForegroundColor Yellow; `
$NewSystemPath=$OldSysPath.Replace('C:\Program Files (x86)\dotnet', 'C:\Program Files\dotnet'); `
Write-Host "**********************************************************************"; `
Write-Host "Your Old PATH was:" -ForegroundColor Green; `
Write-Host "$($OldSysPath)"; `
Write-Host "**********************************************************************"; `
Write-Host "Your New PATH will be:" -ForegroundColor Green; `
Write-Host "$($NewSystemPath)"; `
Write-Host "Press enter to continue (Ctrl+C to ABORT)" -ForegroundColor Red -NoNewLine; Read-Host; `
Write-Host "**********************************************************************"; `
[System.Environment]::SetEnvironmentVariable('PATH', $NewSystemPath, [System.EnvironmentVariableTarget]::Machine) `
}
$OldSysPath=[System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine); `
$Hasx86=($OldSysPath.Split(';') | ? { $_.StartsWith('C:\Program Files (x86)\dotnet')}).Count -gt 0; `
if ($Hasx86) {
Write-Host "**********************************************************************"; `
Write-Host "If you're seing this message your SYS PATH is improperly set" -ForegroundColor Yellow; `
$NewSystemPath=$OldSysPath.Replace('C:\Program Files (x86)\dotnet', 'C:\Program Files\dotnet'); `
Write-Host "**********************************************************************"; `
Write-Host "Your Old PATH was:" -ForegroundColor Green; `
Write-Host "$($OldSysPath)"; `
Write-Host "**********************************************************************"; `
Write-Host "Your New PATH will be:" -ForegroundColor Green; `
Write-Host "$($NewSystemPath)"; `
Write-Host "Press enter to continue (Ctrl+C to ABORT)" -ForegroundColor Red -NoNewLine; Read-Host; `
Write-Host "**********************************************************************"; `
[System.Environment]::SetEnvironmentVariable('PATH', $NewSystemPath, [System.EnvironmentVariableTarget]::Machine) `
}
Sven
SvenOP2y ago
No idk where that is located
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
Sven
SvenOP2y ago
@TeBeCo @ZZZZZZZZZZZZZZZZZZZZZZZZZ
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
No description
Sven
SvenOP2y ago
It just says 7.0 lol
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2y ago
* close VS * remove the hidden folder .vs * remove all bin and obj folder next to each csproj (DO NOT TOUCH THE .git FOLDER OR WHAT'S INSIDE) * restart vs
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
yup still
No description
Sven
SvenOP2y ago
It's so strange why I can't make my target framework 7.0
No description
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
What you mean? restart pc?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
I've restarted VS already
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
Screenshot of this?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
No description
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
Okay will do
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
Yea we could try
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
Okay great, i'm doing that right now I'll update you asap
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
I dont mind, only need net7
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP2y ago
It worked thanks bro @TeBeCo
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2y ago
Use the /close command to mark a forum thread as answered

Did you find this page helpful?