C
C#13mo ago
Sven

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

No description
59 Replies
Sven
SvenOP13mo ago
I've installed .NET 7.0 already
Angius
Angius13mo ago
Framework version should not have a v net7 net8 And so on
Sven
SvenOP13mo ago
Where do you see that and how to fix it?
Angius
Angius13mo ago
Ah, wait, you have <TargetFrameworkVersion> not <TargetFramework>, huh
Sven
SvenOP13mo ago
Idk this is automatically generated
Angius
Angius13mo ago
By?
Sven
SvenOP13mo 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
Angius13mo ago
What is it, exactly? A Unity game project? What generated this .csproj file?
Sven
SvenOP13mo ago
No a console c# project .net core
Sven
SvenOP13mo ago
No description
Angius
Angius13mo ago
That... should not have created a .csproj that looks like this
Sven
SvenOP13mo ago
Weird. He is also working with VS 2022 just like me. Also with the same version
Sven
SvenOP13mo ago
so basically this line should be replaced?
No description
Angius
Angius13mo ago
Did he create a Console App or Console App (.NET Framework)? also, can you post the whole csproj? $paste
MODiX
MODiX13mo 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
Angius13mo ago
Here for example
Sven
SvenOP13mo ago
Just console app
Sven
SvenOP13mo ago
Angius
Angius13mo ago
Yeah I have no idea what it is This looks nothing like a console app csproj
Sven
SvenOP13mo ago
So strange
Angius
Angius13mo ago
No description
Angius
Angius13mo 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
SvenOP13mo ago
Strange
Sven
SvenOP13mo 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
Angius13mo ago
Do you happen to have globals.json somewhere in this project?
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX13mo 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
SvenOP13mo ago
No idk where that is located
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
Sven
SvenOP13mo ago
@TeBeCo @ZZZZZZZZZZZZZZZZZZZZZZZZZ
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
No description
Sven
SvenOP13mo ago
It just says 7.0 lol
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX13mo 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 User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
yup still
No description
Sven
SvenOP13mo ago
It's so strange why I can't make my target framework 7.0
No description
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
What you mean? restart pc?
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
I've restarted VS already
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
Screenshot of this?
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
No description
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
Okay will do
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
Yea we could try
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
Okay great, i'm doing that right now I'll update you asap
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
I dont mind, only need net7
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Sven
SvenOP13mo ago
It worked thanks bro @TeBeCo
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX13mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server