Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed support for .Net Framework 4.6 #25

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using DS = DataStreams.Csv;
using LW = LumenWorks.Framework.IO.Csv;
using CH = CsvHelper;
using System.Collections.Generic;
using System;

namespace NLight.Tests.Benchmarks.IO.Text
{
Expand Down Expand Up @@ -106,7 +108,7 @@ public static void ReadAll_DataStreams(DelimitedRecordReaderBenchmarkArguments a

public static void ReadAll_CsvHelper(DelimitedRecordReaderBenchmarkArguments args)
{
var config = new CH.Configuration.Configuration
var config = new CH.Configuration.CsvConfiguration(System.Globalization.CultureInfo.InvariantCulture)
{
BufferSize = args.BufferSize,
AllowComments = true,
Expand All @@ -124,9 +126,11 @@ public static void ReadAll_CsvHelper(DelimitedRecordReaderBenchmarkArguments arg
{
while (reader.Read())
{
var record = reader.Context.Record;
for (int i = 0; i < record.Length; i++)
s = record[i];
IDictionary<string,Object> record = (IDictionary<string, Object>)reader.GetRecord<dynamic>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a more elegant (and faster) way to read values from the record?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I´m not used to the CsvHelper library. I just tried to make the code working. Should I downgrade the CsvHelper nuget package to the old version, so that the original code is working again?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at CsvHelper Reader class source, I think new code should be (did not test it)

while (reader.Read())
{
    for (int i = 0; i < reader.ColumnCount; i++)
        s = reader[i];
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it´s working with this code.

foreach (var str in record.Values)
{
s = (string)str;
}
}
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/NLight.Tests.Benchmarks/NLight.Tests.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="6.1.1" />
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="LumenWorks.Framework.IO" Version="3.8.0" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/NLight.Tests.Unit/NLight.Tests.Unit.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="NUnit" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 6 additions & 7 deletions src/NLight/NLight.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
<Version>2.1.1</Version>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to target .NET 6 here as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the settings to netstandard, so people who are still using classic .net framework are still able to use this library.

<Version>2.2.0</Version>
<Copyright>Copyright (c) 2009 Sébastien Lorion</Copyright>
<Authors>Sébastien Lorion</Authors>
<Company />
<Description>Toolbox for .NET projects</Description>
<PackageProjectUrl>https://github.com/slorion/nlight</PackageProjectUrl>
<PackageTags>io,parser,csv,delimited,transaction,reactive,tree</PackageTags>
<PackageReleaseNotes>Added multi-targeting support for .NET 4.6</PackageReleaseNotes>
<PackageReleaseNotes>Increased compatibility to newer .net versions. Minimum supported .NET Version is 4.7.2 (.NET Standard 2.0)</PackageReleaseNotes>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change to "Increased compatibility with newer .NET versions. Updated Reactive dependency to 5.0. NLight targets .NET Standard 2.0 (.NET Framework 4.6.1+, .NET Core 2.0+)."

See https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0#net-5-and-net-standard for compatibility matrix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done.

<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>C:\projects\oss\nlight\src\NLight.snk</AssemblyOriginatorKeyFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NeutralLanguage>en</NeutralLanguage>
<RepositoryUrl></RepositoryUrl>
<FileVersion>2.1.1.0</FileVersion>
<AssemblyVersion>2.1.1.0</AssemblyVersion>
<FileVersion>2.2.0.0</FileVersion>
<AssemblyVersion>2.2.0.0</AssemblyVersion>
<PackageLicenseUrl>https://github.com/slorion/nlight/blob/master/LICENSE</PackageLicenseUrl>
</PropertyGroup>

Expand All @@ -37,8 +37,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="System.Reactive.Core" Version="3.1.1" />
<PackageReference Include="System.Reactive.Core" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down