winforms and .net 6?

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Posts: 14
Joined: Sat Jun 26, 2021 4:27 am

winforms and .net 6?

Post by mat-d » Sat Dec 24, 2022 9:00 pm


I'm getting this warning when importing lightning charts with nuget into a .net 6 project.

If I try and drop a chart from the tool box onto a view in the visual designer visual studio crashes.

Warning NU1701
Package 'LightningChart' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0-windows7.0'. This package may not be fully compatible with your project.

Do you have any winforms sample projects for .net 6? Any wpf projects for .net 6?

thanks Mat

Posts: 475
Joined: Mon Mar 14, 2016 9:22 am

Re: winforms and .net 6?

Post by ArctionKestutis » Tue Dec 27, 2022 9:29 am

Warning is normal under this circumstances. You could suppress warning 1701;1702 in project's build settings (under Errors and Warning).
The reason for this warning that LightningChart's control build target (for few latest releases) is .NET Framework 4.5.2. However, starting with .NET Standard 2.0, the .NET Framework compatibility mode was introduced. Therefore, this compatibility mode allows .NET 5/6 and .NET Core projects to reference .NET Framework libraries.

You could find one of Demo examples converted to .NET 6.0 project attached
(7.14 KiB) Downloaded 6 times
ExampleCursorTrackingXY.jpg (326.34 KiB) Viewed 40 times

By using our Demo’s (Interactive Examples App) extraction tool, you could get example’s project (if that was already converted to WinForms, MVVM or UWP). Note, however, that source code of Examples is extracted as .NET Framework project (v.4.5.2). You could either migrate project to .NET 6.0 or start new project and copy relevant parts.

To migrate .NET Framework project you can use this migration tool. Download CsprojToVs2017 app and build it. Then run Command Prompt and navigate executable folder (e.g. CsprojToVs2017-master\Project2015To2017.Migrate2019.Tool\bin\Debug\net6.0). Then run command > dotnet-migrate-2019 wizard “.\MyProjectDirectory”
Finally open converted project/solution and set Target framework (in project properties) to .NET 6.0. Note you may need to add LightningChart references again as maybe removed by migration process (e.g. Arction.WinForms.Charting.LightningChart.dll).

Hope this helps.

Post Reply