C
C#2y ago
LuizBorges

❔ Nuget incompatible with framework

I'm new to nuget and I'm trying to add CsvHelper to a project. I tried all .NET Frameworks from 6.0 to 8.0, all with the same result: - error: NU1100: Unable to resolve 'CsvHelper (>= 30.0.1)' for 'net6.0' - Package 'CsvHelper' is incompatible with 'all' frameworks in project Am I doing something wrong? How this should work? CsvHelper is marked as compatible with net6.0 and still didn't work.
16 Replies
LuizBorges
LuizBorgesOP2y ago
The .csproj
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

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

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Tvde1
Tvde12y ago
you should be able to install version 30.0.1 for net6.0 what error do you get?
LuizBorges
LuizBorgesOP2y ago
The error I mentioned above (incompatible with all frameworks), here is an screenshot (the text is in portuguese)
LuizBorges
LuizBorgesOP2y ago
this is on net8.0, but on net6.0 it gave me the same exact error (as in net7.0)
Tvde1
Tvde12y ago
I I don't think it targets net8 or 7 yet it does target net7
LuizBorges
LuizBorgesOP2y ago
but on 6.0 it gave me the same error, also, isn't the packages supposed to work on newer frameworks?
Tvde1
Tvde12y ago
it really should give a different error for .net 6 or 7 because for .net 8 it shows there is no version 30.0.1 that targets .net 8
LuizBorges
LuizBorgesOP2y ago
wait a sec
LuizBorges
LuizBorgesOP2y ago
Tvde1
Tvde12y ago
do you happen to have a csproject named "CsvHelper"?
LuizBorges
LuizBorgesOP2y ago
No, this is a newly formated PC and I haven't even developed anything in it yet. Just installed VSCode and sdks
Tvde1
Tvde12y ago
hmm it works for me
LuizBorges
LuizBorgesOP2y ago
Not sure if I'm missing something
Tvde1
Tvde12y ago
When I run the same commands I get
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
</ItemGroup>

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

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
</ItemGroup>

</Project>
LuizBorges
LuizBorgesOP2y ago
I will try to reinstall all sdks etc
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server