Skip to content
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

[Bug]: Ribbon in .NET 6 (was 5) designer can't add a linegroup or anything else to a tab group #262

Open
Tape-Worm opened this issue Aug 12, 2021 · 32 comments
Assignees
Labels
area:designer All issues related to the designer. awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. bug Something isn't working

Comments

@Tape-Worm
Copy link

Describe the bug
After adding a group to the tab in the ribbon, the next level of containers fail with an error about abstract classes.

To Reproduce

  1. Add a tab (using the properties pane)
  2. Add a group
  3. Errors on next container level

Expected behavior
Should allow adding of a line group, or other container types.

Screenshots
Screen shot available here:
#260 (comment)

@Tape-Worm Tape-Worm added the bug Something isn't working label Aug 12, 2021
@Smurf-IV
Copy link
Member

Smurf-IV commented Sep 5, 2021

Check with #178

@Tape-Worm
Copy link
Author

FYI, this problem is getting very difficult to manage.

The workaround provided only works for simple projects. Anything remotely complex (e.g. with custom controls embedded into the form) starts becoming difficult, at best, and impossible at worst, to manage.

Since I'm writing an API that allows users to write their own plug ins for this application this issue, makes it so others can't use my stuff without implementing a rather annoying hack to make it work which can require some intimate knowledge of how all this stuff works under the hood.

Has there been any progress on getting this issue fixed? Would you like me to do some testing for you guys on this?

@Smurf-IV
Copy link
Member

Has there been any progress on getting this issue fixed?

It is really annoying - I agree.
I'm still battling with this, and it seems that it has got worse now that VS16.11 has released, as NO controls show up !
As linked- check the progress against #178 and the others linked to it..

implementing a rather annoying hack to make it work

Can you elaborate on your workaround ?

@Tape-Worm
Copy link
Author

It's just the standard workaround where you make the project target multiple frameworks, one for 4.8 and the other for 5.0. The other workaround where you link to a control/form in a separate .NET 4.8 project is even worse as soon as you add a single custom control and/or embedded resources.

Within my project, the first workaround works fine, but when I try to use it outside of my project source code that's when it all breaks down. Because I do not ship out the 4.8 code, users cannot link against my APIs and they cannot access the ribbon and create their own ribbon interface using .net 5 - which is something that I really want to expose.

I also tried a code-first approach where I started to create a ribbon builder, and that looked promising until I found that I could not access the controls by name via the control hierarchy in the ribbon.

As for why I don't ship out the 4.8 projects: I have a lot of C# 9 code, and there's parts (e.g. major parts of the Record type) that just don't work in 4.8 regardless of langversion. I #ifdef those lines of code out, thus making the .NET 4.8 code unusable (but can still compile).

If I had the ability to turn off the 4.8 framework, and the ribbon allowed me to set it up in the .NET 5 designer, then all of this would no longer be an issue.

@Smurf-IV
Copy link
Member

Thanks for the report.. I'll keep pushing to try to fix each time I do a PR.

@Tape-Worm
Copy link
Author

Thank you

@Smurf-IV Smurf-IV self-assigned this Sep 15, 2021
@Smurf-IV Smurf-IV added the under investigation This bug/issue is currently under investigation. label Sep 15, 2021
@Smurf-IV
Copy link
Member

So following the "Manual" method of adding via the properties, and then adding into each collection (Rather than clicking in the design area and performing add).
It (Canary V2108.1) eventually spits out this:
image

But the Attached Debugger to visual studio didn;t even blink, so this is a reflection mess !

@Tape-Worm
Copy link
Author

Yep, that's what I've been getting. I could be wrong, but that designer looks like it's a standard .NET designer? That could be why you're not seeing anything in the debugger?

@sdreb3421
Copy link

Sorry for the sidebar question. I'm preparing to upgrade a large net48 project to NET5. I'm hesitating since it uses krypton controls extensively throughout the application. I've been digging through the open issues to try and piece together any issues I might expect, but it's hard to determine what's remaining. Other than the issue presented above, is the next stable build of krypton expected to have any remaining NET5 designer or runtime bugs? I'm fine with targeting multiple frameworks if necessary. Or would it be safer to wait until next year? Thanks

@Smurf-IV
Copy link
Member

This is still a problem in <PackageReference Include="Krypton.Toolkit.Nightly" Version="6.2110.296-alpha" />
in Visual studio 16.11.4

@Smurf-IV
Copy link
Member

Ribbon Controls demo - nuget
.Net5 only (Edit csproj, close and re-open visual studio to ensure any dll is "Flushed")
Document outline looks like this and the tab control does not respond to click events in designer
image

@Smurf-IV
Copy link
Member

Redo but only have .net48 in csproj:
Loads more controls:
image

and designer is clickable:
image

@Smurf-IV
Copy link
Member

Smurf-IV commented Oct 24, 2021

@sdreb3421

  1. is the next stable build of krypton expected to have any remaining NET5 designer or runtime bugs?
  2. I'm fine with targeting multiple frameworks if necessary.
  3. Or would it be safer to wait until next year? Thanks
  1. looks like it might
  2. that is the safest way forward for the designer work, and then just push / install from the .net5 build bin directory
  3. It is only the designer code when loaded into Visual Studio that is causing a problem. The actual runtime code is the sme as is fine.

@sdreb3421
Copy link

@Smurf-IV thanks for the update. I just figured out that one of my libraries (OpenTK) does not play nice between framework and core, so I can't target multiple frameworks.

If it's only the ribbon that has issues I could just handle UI changes programmatically. Do you know of any other designer issues with net5 krypton controls?

@Smurf-IV
Copy link
Member

FYI
If you need to target different targets then the csproj can do that for you via Choose and When clauses, or just plain name matching.

  • See how Toolkit works out what to do about framework and net5 etc
  • Or check out the examples (Alpha branch) to see how it switches between include and nuget

@Smurf-IV
Copy link
Member

In Visual Studio 17P7 it's even worse with just .net5 :
image

@Smurf-IV
Copy link
Member

Smurf-IV commented Oct 31, 2021

But the Collection editors (Sort of like designers) can be accessed via the Collection properties:
image

@Smurf-IV
Copy link
Member

Smurf-IV commented Oct 31, 2021

Also the Toolbox does not list "Any" Krypton components! (And they do not in 16.11.4 either!)
image

@Tape-Worm
Copy link
Author

Just checking in on this to see if there's been any progress on fixing the designer issue? Will you need the new Windows Forms SDK to make this work?

@Wagnerp
Copy link
Contributor

Wagnerp commented Apr 7, 2022

Hi @Tape-Worm

A discussion has been posted here #684

@Wagnerp
Copy link
Contributor

Wagnerp commented Apr 17, 2022

Hi @Tape-Worm

Yes the new Windows Forms SDK will be needed to fix this, since Microsoft broke something in-between 4.8 and .NET Core. One solution that may work is to add 'net48' to your 'TargetFrameworks'. This will force the designer to use a previous version.

@Smurf-IV
Copy link
Member

I know this started with ".net5 ...."
But ".NET 5.0 will reach End of Support on May 08, 2022"
So I have changed the title to .Net6 to keep it relevant (And I'm still checking any solution !!)

@Smurf-IV Smurf-IV changed the title [Bug]: Ribbon in .NET 5 designer can't add a linegroup or anything else to a tab group [Bug]: Ribbon in .NET 6 (was 5) designer can't add a linegroup or anything else to a tab group Apr 18, 2022
@Smurf-IV
Copy link
Member

dotnet/winforms#7073

@jfriborg
Copy link

jfriborg commented Oct 1, 2022

Hi. Any updates on this issue?
I'm experiencing the same error, ...because it is an abstract class, when trying to add an item to a ribbon group.
I'm using VS 2022, .NET 6 and v65.22.6.152 of the Krypton.Ribbon package.
I'm not able to use the suggested workaround with multiple target frameworks or just net48 due to some 3rd part components i have to use...

@giduac
Copy link

giduac commented Oct 1, 2022

Not really, everyone is waiting for this.

#684

@Wagnerp
Copy link
Contributor

Wagnerp commented Oct 1, 2022

Hi @jfriborg

Can't really fix until the WinForms designer is properly fixed for .NET.

@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 6, 2022

@Wagnerp
Copy link
Contributor

Wagnerp commented Dec 6, 2022

@Smurf-IV Does this need to be a new feature request to add/fix designers?

@Wagnerp Wagnerp added the area:designer All issues related to the designer. label Dec 6, 2022
@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 6, 2022

I think this was supposed to be left open waiting for the MS, then it would be fixed against this.
There are other "bugs" in the backlog which also refer to designer issues, so they should all be taken into account.

@Wagnerp
Copy link
Contributor

Wagnerp commented Dec 6, 2022

I think this was supposed to be left open waiting for the MS, then it would be fixed against this. There are other "bugs" in the backlog which also refer to designer issues, so they should all be taken into account.

@Smurf-IV Great, if you come across any bug reports relating to this, please apply the 'designer' tag if not already applied

@Smurf-IV Smurf-IV removed the under investigation This bug/issue is currently under investigation. label Dec 11, 2022
@Smurf-IV
Copy link
Member

Smurf-IV commented Oct 1, 2023

To summarize: (Tested in VS 17.7.4, and using the 80.23.8.233 canary build)

The following exception is being thrown when using the "Debug dev" or "Debug Nuget" solutions; When opened in VS 17.8.p2:
image

BUT
If a new project is started And the ribbon added then the experience is as per #262 (comment) for net48 projects as well ???

@Smurf-IV Smurf-IV removed their assignment Dec 17, 2023
@giduac
Copy link

giduac commented Aug 29, 2024

Hi @Tape-Worm, @Smurf-IV & @Wagnerp

What is the status of this ticket?

@giduac giduac self-assigned this Aug 29, 2024
@giduac giduac added the awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:designer All issues related to the designer. awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants