Gaweringo
Gaweringo
CC#
Created by Gaweringo on 11/2/2023 in #help
`dotnet build` errors NU1202 but building in IDE works
I finally got it! I had a dotnet 3.0.3 Runtime installed and also the dotnet3-sdk via scoop (for some old thing I tried to build, that I can't even remember right now). I uninstalled that and now it works. I found it as it was in some paths that This SO Answer talked about. Anyways, thanks a lot for your help and time :)
13 replies
CC#
Created by Gaweringo on 11/2/2023 in #help
`dotnet build` errors NU1202 but building in IDE works
❯ dotnet --list-sdks
7.0.401 [C:\Program Files\dotnet\sdk]
7.0.402 [C:\Program Files\dotnet\sdk]
❯ dotnet --list-sdks
7.0.401 [C:\Program Files\dotnet\sdk]
7.0.402 [C:\Program Files\dotnet\sdk]
13 replies
CC#
Created by Gaweringo on 11/2/2023 in #help
`dotnet build` errors NU1202 but building in IDE works
Yeah I tried downgrading NpgSql to 7.0.4 but still the same. I also tried creating a new ASP.NET Core with Angular project in VS and tried running dotnet build without doint anything else and I get this error:
C:\Program Files\dotnet\sdk\7.0.402\Microsoft.Common.CurrentVersion.targets(1241,5): error MSB3971: The reference assem
blies for ".NETFramework,Version=v7.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or highe
r. Update Visual Studio and/or your .NET SDK. [C:\...\AngularTestVS\AngularTestVS\AngularTestVS.c
sproj]

Build FAILED.
C:\Program Files\dotnet\sdk\7.0.402\Microsoft.Common.CurrentVersion.targets(1241,5): error MSB3971: The reference assem
blies for ".NETFramework,Version=v7.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or highe
r. Update Visual Studio and/or your .NET SDK. [C:\...\AngularTestVS\AngularTestVS\AngularTestVS.c
sproj]

Build FAILED.
Which says something about .NETFramework which is also in the other error message and confuses me somewhat with .NET Framework being the old pre .NET Core thing. Especially because the first error message is posted has this: not compatible with net70 (.NETFramework,Version=v7.0).... supports: C:\...Web.csproj : error NU1202: - net6.0 (.NETCoreApp,Version=v6.0)
13 replies
CC#
Created by Gaweringo on 11/2/2023 in #help
`dotnet build` errors NU1202 but building in IDE works
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<SpaProxyServerUrl>https://localhost:44442</SpaProxyServerUrl>
<SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
<RootNamespace>PlayCount_Web</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<TargetFramework>net7.0</TargetFramework>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Common" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.13">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
</ItemGroup>

<!-- Other things about angular -->
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<SpaProxyServerUrl>https://localhost:44442</SpaProxyServerUrl>
<SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
<RootNamespace>PlayCount_Web</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<TargetFramework>net7.0</TargetFramework>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Common" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.13">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
</ItemGroup>

<!-- Other things about angular -->
13 replies