C
C#15mo 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
LuizBorges15mo 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
Tvde115mo ago
you should be able to install version 30.0.1 for net6.0 what error do you get?
LuizBorges
LuizBorges15mo ago
The error I mentioned above (incompatible with all frameworks), here is an screenshot (the text is in portuguese)
LuizBorges
LuizBorges15mo ago
this is on net8.0, but on net6.0 it gave me the same exact error (as in net7.0)
Tvde1
Tvde115mo ago
I I don't think it targets net8 or 7 yet it does target net7
LuizBorges
LuizBorges15mo ago
but on 6.0 it gave me the same error, also, isn't the packages supposed to work on newer frameworks?
Tvde1
Tvde115mo 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
LuizBorges15mo ago
wait a sec
LuizBorges
LuizBorges15mo ago
Tvde1
Tvde115mo ago
do you happen to have a csproject named "CsvHelper"?
LuizBorges
LuizBorges15mo ago
No, this is a newly formated PC and I haven't even developed anything in it yet. Just installed VSCode and sdks
Tvde1
Tvde115mo ago
hmm it works for me
LuizBorges
LuizBorges15mo ago
Not sure if I'm missing something
Tvde1
Tvde115mo 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
LuizBorges15mo ago
I will try to reinstall all sdks etc
Accord
Accord15mo 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
More Posts