C
C#2y ago
Macke

✅ How can i change the target Framework?

Severity Code Description Project File Line Suppression State
Error NETSDK1045 The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. BlazorApp1 C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 144
Severity Code Description Project File Line Suppression State
Error NETSDK1045 The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. BlazorApp1 C:\Program Files\dotnet\sdk\6.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 144
8 Replies
Macke
MackeOP2y ago
or rather how to i switch the SDK on my project?
Angius
Angius2y ago
In the .csproj file Or install the missing SDK
Macke
MackeOP2y ago
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>77a5d0ea-3768-4f64-b19b-b2a52cbe01c7</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.61" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.80" />
<PackageReference Include="RestSharp" Version="108.0.3" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>77a5d0ea-3768-4f64-b19b-b2a52cbe01c7</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.61" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.80" />
<PackageReference Include="RestSharp" Version="108.0.3" />
</ItemGroup>

</Project>
@Angius I know that .NET 7.0 is installed should be let me double check
Macke
MackeOP2y ago
Macke
MackeOP2y ago
can't find it, do i have the wrong version of the installer?
Angius
Angius2y ago
What version of Visual Studio? If it's 2022, you might need to update
Macke
MackeOP2y ago
i'm updating, we'll see if it solves it @Angius yup that fixed it. I feel stupid now. Thanks
Accord
Accord2y ago
Closed!
Want results from more Discord servers?
Add your server