Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Use Size from System.Drawing instead of WindowsBase #26

Merged
merged 1 commit into from
Feb 10, 2020
Merged

Use Size from System.Drawing instead of WindowsBase #26

merged 1 commit into from
Feb 10, 2020

Conversation

weltkante
Copy link
Contributor

@weltkante weltkante commented Feb 10, 2020

Fixes #24

This assembly was provided inbox on Desktop Framework and has been ported to .NET Core in order to support porting of applications making use of it.

The source code lives in System.Windows.Forms.DataVisualization.Charting and wants to use System.Drawing.Size by importing its namespace via using System.Drawing. Due to .NET Core adding an implicit reference to WindowsBase which contains System.Windows.Size from WPF (which was not referenced in Desktop Framework) any unqualified source code reference to Size may silently prefer the WPF version because it lives in a parent namespace (in contrast to an imported namespace).

References which were leading to conflicts had been resolved in the initial port, but some occurences which did not lead to compile-time conflicts were missed, which leads to both design-time and runtime errors.

Proposed changes

  • Remove all references to the Size type from WindowsBase by adding appropriate aliases

Customer Impact

  • Fixes a regression from Desktop Framework:
    • The designer attribute for the chart size was referencing the wrong type.
    • The custom serialization code referenced the wrong Size types.

Regression?

  • Yes, regression in port from Desktop Framework

Risk

  • Low, bug was not present in Desktop Framework, it is unlikely anyone took a dependency on it since there are no known workarounds

Test methodology

  • Inspected the resulting assembly of a local build with ildasm to make sure the assembly reference to WindowsBase is gone, indicating the compiler no longer resolves any symbols against WindowsBase

  • Code from initial issue report runs without exception

@weltkante weltkante requested a review from a team as a code owner February 10, 2020 21:43
Copy link
Member

@KlausLoeffelmann KlausLoeffelmann left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@RussKie RussKie merged commit 7a4c05e into dotnet:master Feb 10, 2020
@RussKie
Copy link
Member

RussKie commented Feb 12, 2020

I have published the new version: https://www.nuget.org/packages/System.Windows.Forms.DataVisualization/1.0.0-prerelease.20110.1
Please let me know if there are ant issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chart.Serializer.Reset() throws an exception
3 participants