Skip to content

.NET Core 3.1 WindowsDesktop application can fail when rolled forward to .NET 5 preview #2921

@DustinCampbell

Description

@DustinCampbell
  • .NET Core Version:
    .NET Core 3.x -> .NET 5

  • Have you experienced this same bug with .NET Framework?:
    No

Problem description:

The System.Windows.Forms.Design.Editors.dll assembly has been removed in .NET 5, which can cause applications built with .NET Core 3.x to fail if they used a type from that assembly and are permitted to roll forward on major versions.

Expected behavior:

The application should not fail. Instead, a System.WinForms.Forms.Design.Editors.dll should be included that contains type forwards for all of the types that were moved out of that assembly. In this way, WinForms on .NET 5 remains binary compatible.

Minimal repro:

  1. Create a .NET Core 3 application.
  2. Add code that references a public type from System.Windows.Forms.Design.Editors.dll, e.g. AnchorEditor.
  3. Build it
  4. Run it
  5. Copy the app to a VM with only .NET5 SDK installed (or remove .NET Core 3.x SDK form your workstation)
  6. Modify a <app name>.runtimeconfig.json with the following content (update the .NET5 SDK version as necessary):
    {
      "runtimeOptions": {
    	"tfm": "netcoreapp3.0",
    	"rollForward": "LatestMajor",
    	"framework": {
    	  "name": "Microsoft.WindowsDesktop.App",
    	  "version": "5.0.0-preview.2.20119.5"
    	}
      }
    }
  7. Run the application and ensure that the code that used the type from System.Windows.Forms.Design.Editors.dll executes.

[EDIT] updated the repro steps

Metadata

Metadata

Assignees

Labels

🪲 bugProduct bug (most likely)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions