WindowsFormsAero icon indicating copy to clipboard operation
WindowsFormsAero copied to clipboard

.NetCore 3.1 support

Open MagicAndre1981 opened this issue 5 years ago • 19 comments

Can you please add .net core 3.1 support, I get this warning:

warning NU1701: Package 'Windows-Forms-Aero 3.1.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

I noticed that ContextMenu is not available for .net core 3.1 which is used in SplitButton and needs to be removed.

MagicAndre1981 avatar Jun 18 '20 12:06 MagicAndre1981

I have a pull request in from last September to fix some code that I wrote back in 2009 when this was on CodePlex that's still outstanding. I'll take a look at adding .NET Core 3/3.1 support. I don't imagine it would be that difficult. I've been using WPF on .NET Core 3.1 with no issues.

blakepell avatar Jul 20 '20 18:07 blakepell

I'll take a look at adding .NET Core 3/3.1 support. I don't imagine it would be that difficult.

do you maintain the code now?

MagicAndre1981 avatar Jul 22 '20 11:07 MagicAndre1981

I do not maintain it, I added a few controls back in 2009 when it was still hosted on CodePlex (the Horizontal Panel, the Vertical Panel and the Labeled Divider).

So I looked at the upgrade support .NET Core as well as the old framework and most everything works. The only thing that's an issue is that ContextMenu was removed from .NET Core 3.1 and as a result, that split view button won't convert in it's current form. The two paths forward are, write new code to make that control work (or have it not build in the .NET Core 3.1 version). Oddly those controls exist in .NET Core 3.0 (but not 3.1). That said, they won't be there going forward so targeting 3.0 is only a half measure solution.

Here is a list of controls removed just for reference.

https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#removed-controls

If I get some time later today I'll works on this some more, at the very least I can probably push a branch up that will get you going and then we can put a pull request in for that and see if the project maintainer wants to merge it.

blakepell avatar Jul 22 '20 14:07 blakepell

So I looked at the upgrade support .NET Core as well as the old framework and most everything works. The only thing that's an issue is that ContextMenu was removed from .NET Core 3.1 and as a result, that split view button won't convert in it's current form. The two paths forward are, write new code to make that control work (or have it not build in the .NET Core 3.1 version). Oddly those controls exist in .NET Core 3.0 (but not 3.1). That said, they won't be there going forward so targeting 3.0 is only a half measure solution.

we both suffer the same issue about ContextMenu . I compiled it for .net core 3.1, referenced the private nuget and it beside this the lib works so far.

This is why I want an official support from developer @LorenzCK

MagicAndre1981 avatar Jul 24 '20 10:07 MagicAndre1981

Hello people! I’m really sorry, but unfortunately I have no free time at all to devote to the project. I would be very glad to give admin access, to both the repository and to the NuGet package, to whomever may be able to keep maintaining the project in the meantime. 😊

LorenzCK avatar Jul 26 '20 16:07 LorenzCK

We all get the time thing, hehe. You're good. I'd be happy to pitch in at least where I'm knowledgeable. At a bare minimum I can get support for .NET Core 3.0 and then as a second step look at replacing the ContextMenu with something else for 3.1.

My Nuget username is blakepell.

I've been working with WPF for .NET Core 3.1 and it's been wonderful. Curious to see if the WinForms designer has caught up, it was in preview for at least a year (up until March). Curious what state it's in now.

blakepell avatar Jul 27 '20 15:07 blakepell

so what is now the status here? Does @blakepell now maintain it? Any update on .net core 3.1 and maybe 5.0 support?

MagicAndre1981 avatar Aug 27 '20 07:08 MagicAndre1981

@MagicAndre1981 Sorry about the delay again, I have finally invited @blakepell as a maintainer for both the repository and the NuGet package! 😊 Thank you so so much for taking up the task. 🙏 I hope to be able to contribute a bit again in the future, looking forward to the migration to .NET Core!

LorenzCK avatar Aug 27 '20 15:08 LorenzCK

I got bogged down in work for work, will take a look at this today. :)

blakepell avatar Sep 10 '20 14:09 blakepell

@LorenzCK Would you mind sending the invitation one more time. I went to merge the pull request and apparently and got a 403 permission denied. Wondering if I viewed the invitation but didn't click accept (it's time expired).

blakepell avatar Sep 10 '20 14:09 blakepell

@MagicAndre1981

I have a 'netcore3' branch on my fork that I've got working. I added support for .NET Framework 4.8, .NET Core 3.0 and .NET Core 3.1. The library project uses the new csproj format which creates the NuGet on the build with the nuspec file. .NET Core 3.1 removed a few controls that are gone for good so I used directives to use the old code for the .NET Framework builds and the new code for the .NET Core projects (really only affect the menus on those split buttons). The old project had an SNK file and I went ahead and brought that forward.

I created a second showcase project that targeted .NET Core 3.1 (and can later be updated for .NET 5). The preview WinForms editor was basically busted until this last release and it's usable now (although when I use a dual monitor where one's 4K it only lets me move controls on the high DPI monitor).

So, on the Aero Glass API's, those API's were never deprecated but just don't work anymore in Windows 10. I'm debating two routes. The first is to add Windows 10 specific API's that can be called and let those two things live side by side. The second is to keep the existing API in place try to figure out by OS if it should call the old DmwEnableBlurBehindWindow or the new SetWindowCompositionAttribute.

blakepell avatar Sep 10 '20 18:09 blakepell

Aero Glass still works in 8.1 and Windows 10 when using a 3rd party component and the screenshot shows errors I get with your branch while compiling:

image

image

In my tests I had to remove net40, I was never able to compile it. I also had to add "System.Resources.Extensions" to get my attempt to compile.

I don't think it is good to have netcore3 support, this version is out of support for 6 months.

image

So remove it and add net5 support, as this version is nearly done now.

I noticed the sourcelink information to step into code without compiling it on your own is also gone.

MagicAndre1981 avatar Sep 11 '20 06:09 MagicAndre1981

from inside VS2019 16.7.3 the solution compiles fine, but not with dotnet command-line. I noticed that the resulting nuget package is version 1.0

MagicAndre1981 avatar Sep 11 '20 08:09 MagicAndre1981

That's fascinating about it working from a 3rd party component, everything I read seemed to indicate otherwise. I'll test with that to see if I can get it working just so I can see that, I did however get the Acrylic somewhat working last night, just have to work out some issues where it would click through the form to whatever was below it.

I'll look at source link also and get that working, good catch.

I'll remove netcore3.0. Good call on the command line build. Through VS mine works to build both in Debug/Release but from the command line Debug works and Release fails with the same exception you had about System.Resources.Extensions not being available. I'll figure out what's up with that.

blakepell avatar Sep 11 '20 15:09 blakepell

@LorenzCK Would you mind sending the invitation one more time. I went to merge the pull request and apparently and got a 403 permission denied. Wondering if I viewed the invitation but didn't click accept (it's time expired).

I didn’t know GitHub invitations had an expiration date, but it has indeed disappeared from the admin panel. Just sent you a new invitation. :)

LorenzCK avatar Sep 11 '20 16:09 LorenzCK

Accepted it this time, hehe. Thanks Lorenz.

blakepell avatar Sep 11 '20 16:09 blakepell

That's fascinating about it working from a 3rd party component,

no, I mean a 3rd party DLL that hooks into DWM is required to get Aero Glass working . Currently it works for 1709/1909, in 190x, Microsoft broke it and developer has limited time to get it working.

MagicAndre1981 avatar Sep 11 '20 16:09 MagicAndre1981

@blakepell any update on this? Do you have some time to look at it? Also .net 5 support would be nice, which will be released soon.

MagicAndre1981 avatar Oct 19 '20 09:10 MagicAndre1981

@blakepell any update on this?

MagicAndre1981 avatar Jan 21 '21 06:01 MagicAndre1981

ok, I can close this as .net core 3.1 is out of support. I created #11 to support .net 6 and 8

MagicAndre1981 avatar Jun 17 '24 08:06 MagicAndre1981