reportviewercore icon indicating copy to clipboard operation
reportviewercore copied to clipboard

Upgrade to .NET6

Open albertomandlate opened this issue 3 years ago • 7 comments

  • Migrating all projecto to .NET 6 and also update the Nuget packages to newer versions.
  • Also update language versions to latest

albertomandlate avatar Jan 24 '22 18:01 albertomandlate

What exactly is the point of targeting .NET 6 and newest C# version?

There are also a few problems with this pull request:

  • Targeting .NET 6 requires VS2022 and RDLC Report Designer extension from Microsoft works only on VS2019.
  • Upgrading those packages to .NET 6 would force update on all the applications already using it.
  • Almost all of the code of the project has been generated with ILSpy targeting C# 8.0, so new language features won't be used anyway.
  • Targeting newer version of Microsoft.CodeAnalysis.VisualBasic also requires targeting exact same version of Microsoft.CodeAnalysis.Analyzers which is tricky, as this package is often already included in specific version by applications. This caused issues earlier and I'd rather not touch those dependencies again.

lkosson avatar Jan 24 '22 18:01 lkosson

If you upgrade the framework on the project, does everybody that uses this package really need to upgrade their Framework to .NET6? I think that no.

So, if I'm right, users don't need to upgrade their framework to 6.

The reason to upgrade to a newer framework is that .NET 6 has a lot of performance improvements in their libraries. That's the main reason. I'm also making some changes to the libraries the checks for OS compatibility. And those alerts, only can be seen on the new C#10. In that way, this nuget can be available on multiplatform.

albertomandlate avatar Jan 25 '22 09:01 albertomandlate

Try setting .NET 6 on one project in this repo (for instance on Microsoft.ReportViewer.Common) and try to compile the solution. You'll get compilation errors on all the ReportViewerCore.Sample.* projects. On the other hand, you can set .NET 6 on any of the ReportViewerCore.Sample.* projects and reference Microsoft.ReportViewer.* assemblies without a warning or performance hit.

To benefit from performance improvements in .NET 6 you don't have to compile your library using newest C# or newest framework. When .NET 6 loads assembly targeting .NET Core 3.1 it performs same optimizations as if it loaded .NET 6 assembly.

This package already targets multiple platforms, although some renderers are unavailable on non-windows OSes.

lkosson avatar Jan 25 '22 09:01 lkosson

Yes, that's true. It's not working. Let try by compiling it to dll first and the adding it to the project.

albertomandlate avatar Jan 25 '22 16:01 albertomandlate

Try setting .NET 6 on one project in this repo (for instance on Microsoft.ReportViewer.Common) and try to compile the solution. You'll get compilation errors on all the ReportViewerCore.Sample.* projects. On the other hand, you can set .NET 6 on any of the ReportViewerCore.Sample.* projects and reference Microsoft.ReportViewer.* assemblies without a warning or performance hit.

To benefit from performance improvements in .NET 6 you don't have to compile your library using newest C# or newest framework. When .NET 6 loads assembly targeting .NET Core 3.1 it performs same optimizations as if it loaded .NET 6 assembly.

This package already targets multiple platforms, although some renderers are unavailable on non-windows OSes.

My friend, try to run your solution from nuget on a .NET 6 project without upgrading the package to .NET 6. It doesn't work!

It happen to me with my .net console application. Maybe you need to have a separate version for .NET 6.

albertomandlate avatar Feb 22 '22 14:02 albertomandlate

As far as I can tell - fresh .NET 6 project with nuget package ReportViewerCore.NETCore referenced and sources copied from ReportViewerCore.Sample.Console compiles and runs just fine.

lkosson avatar Feb 23 '22 07:02 lkosson

I have published new packages (15.1.16) which provide separate DLLs for different .NET versions.

lkosson avatar Mar 14 '22 07:03 lkosson