Upgrade to .NET6
- Migrating all projecto to .NET 6 and also update the Nuget packages to newer versions.
- Also update language versions to latest
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.VisualBasicalso requires targeting exact same version ofMicrosoft.CodeAnalysis.Analyzerswhich 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.
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.
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.
Yes, that's true. It's not working. Let try by compiling it to dll first and the adding it to the project.
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 theReportViewerCore.Sample.*projects. On the other hand, you can set .NET 6 on any of theReportViewerCore.Sample.*projects and referenceMicrosoft.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.
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.
I have published new packages (15.1.16) which provide separate DLLs for different .NET versions.