-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET Core 3.1 WindowsDesktop application can fail when rolled forward to .NET 5 preview #2921
Comments
As part of consolidation initiative (refer to dotnet#2781) we have merged System.Windows.Forms.Design.Editors.dll into System.Windows.Forms.Design.dll. However doing so we broke roll-forward upgrades for any app depending on types delcared in System.Windows.Forms.Design.Editors.dll. Create a facade assembly that forwards types from original assembly. Resolves dotnet#2921.
@RussKie @merriemcgaw just FYI if you intend to preserve binary compatibility between 3.x and 5.0 you cannot add proper generic collection support (#2644). Return types of GetEnumerator have to change in order for IMHO requiring a recompile for 5.0 is not entirely unreasonable and its probably one of the better chances to modernize winforms, it'll probably only get harder from there on. So ultimately you'll have to make a strategic decision here what your goal for the 3.x/5.0 transition is, and the sooner its done and communicated the better. |
#2925 has more binary incompatibility |
Trying this repro and testing Igor's fix shortly. |
@weltkante thank you, but you may be misinterpreting the intent of this work. Whilst this bug is may affect our users, and it may not be totally unreasonable to ask to recompile, it is not the main driving factor here. The bug is currently blocking the VS Designer from rendering previews for different versions of .NET Core/.NET (due to a number of API moved from one assembly to another), and we don't expect to build a version of the Designer for each .NET version. Other API proposals likely won't have a significant effect on the Designer, as those do not touch type editors and type converters. |
@RussKie I'm just saying that if #2644 is implemented the work done here doesn't matter because roll-forward will fail anyways as soon as anyone has an
You'll have to make sure not using foreach loops over WinForms collections in the designer then (probably can pass the collection through a helper method so the foreach doesn't see the specific class you are iterating over) |
@weltkante: Why would roll forward break with #2644 for foreach loops? I would expect that |
The interface doesn't matter, Roslyn doesn't look at the interface, it looks at the return type of public You can implement generic collections without changing the return type (for LINQ support) but then you won't get |
@weltkante: I suppose that would result in a break if my application was previously compiled against the public I'd be very interested in a proposal that improves productivity with the existing APIs without breaking the entire ecosystem to do. |
As part of consolidation initiative (refer to #2781) we have merged System.Windows.Forms.Design.Editors.dll into System.Windows.Forms.Design.dll. However doing so we broke roll-forward upgrades for any app depending on types delcared in System.Windows.Forms.Design.Editors.dll. Create a facade assembly that forwards types from original assembly. Resolves #2921.
As part of consolidation initiative (refer to dotnet#2781) we have merged System.Windows.Forms.Design.Editors.dll into System.Windows.Forms.Design.dll. However doing so we broke roll-forward upgrades for any app depending on types delcared in System.Windows.Forms.Design.Editors.dll. Create a facade assembly that forwards types from original assembly. Resolves dotnet#2921.
.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:
System.Windows.Forms.Design.Editors.dll
, e.g.AnchorEditor
.<app name>.runtimeconfig.json
with the following content (update the .NET5 SDK version as necessary):System.Windows.Forms.Design.Editors.dll
executes.[EDIT] updated the repro steps
The text was updated successfully, but these errors were encountered: