Winforms: Porting System.Windows.Forms.DataVisualization to .NET core

Created on 1 Dec 2018  路  6Comments  路  Source: dotnet/winforms

Creating this issue to track the porting of System.Windows.Forms.DataVisualization.dll into Core.

  • We have seen multiple reports on not being able to migrate because of missing the dll in core.
  • Porting of this binary may have dependency on System.Data.Oledb.
  • Winforms applications using "Chart" control are primary target of this issue.
enhancement tenet-compatibility

Most helpful comment

This assembly eagerly attempts to load OleDB types - which is problematic unless and until we port OleDB to .NET Core. However it looks quite possible to segregate the OleDB types so that they are only loaded if the caller actually wants to use OleDB and this would be worth doing.

All the usage is in a single class ChartImage and it is all protected by checks like if (obj is OleDbDataAdapter). Those can likely be replaced with if (obj.GetType().FullName == "System.Data.OleDbDataAdapter") or similar -- and only if the test is true then would it call into a new class that would reference these types properly and cause them to load.

All 6 comments

This assembly eagerly attempts to load OleDB types - which is problematic unless and until we port OleDB to .NET Core. However it looks quite possible to segregate the OleDB types so that they are only loaded if the caller actually wants to use OleDB and this would be worth doing.

All the usage is in a single class ChartImage and it is all protected by checks like if (obj is OleDbDataAdapter). Those can likely be replaced with if (obj.GetType().FullName == "System.Data.OleDbDataAdapter") or similar -- and only if the test is true then would it call into a new class that would reference these types properly and cause them to load.

I work on a project which generates charts server side into images and it would be great to get that onto Core as it's the only part of the app which still relies on .NET Framework.

Would love to see this - there is no reasonable way to achieve charting in .NET Core without it!
Is there a way I can do the required work?

@davidnmbond apparently this is already mostly done, @merriemcgaw commented something along those lines in #510

We have DataVisualization in preview 4 now. And most of sad thing it's considered deprecated :((
I posted a question about it...

I have added guidance on using the new ported types to our porting guidelines https://github.com/dotnet/winforms/blob/master/Documentation/porting-guidelines.md#include-the-systemwindowsformsdatavisualization-pack

Was this page helpful?
0 / 5 - 0 ratings