Hi there
I am having issues viewing my controls in the VIsual Studio 2019 16.10.4 where I am compiling against Infragistcs 2021.1 v 21.1.32-ci
This is in a C# WinForms app targeted at net5.0-windows
Basically none of my controls will display in the designer without errors.
The controls all compile fine and are all usable at runtime, the issue occurs only in the control designer and for even the most basic of controls i.e. a panel that inherits from the UltraPanel and does nothing else
The errors are always the same across all controls.
I have attached the control and a screenshot of the error.
Any ideas would be greatly appreciated.
Regards
Geoff
Hi Mike
Thanks for the reply.
Yeah that is exactly the conclusion I came to myself thru trial and error.
Interestingly the CustomControl that is available from the Visual Studio "Add New Item" templates derives also from Control and gets a designer error straight out of the box!
I raised this on both Github and Visual Studio Developer Community and both say it is a known issue that is being investigated.
Thanks again
Hi Geoff, So I have good news and bad news. I tried this out with v 21.1.32-ci and I am seeing the same exception you are getting: the NullReferenceException.Then I tried this same thing with our latest internal build and I do not get that exception any more. So it looks like this will be fixed in the next service release. That's the good news. The bad news is that it looks like Visual Studio doesn't show a designer for Control-derived classes in Net Core. In DotNet Framework, they do. But in Net Core, they only show a designer surface for classes that derive from Form or UserControl. You can see this by creating a class that derives from Control. When I do this, I get an error message that there are no classes to be designed.
Hi Mihoko
Great, thanks for that, please keep me informed.
Okay.. ignore the comments above. I finally realized that you are not right-clicking on the control on the form, but rather on the File in the Solution Explorer. I tried this out with the latest ci build (32-ci) that you are using and I can reproduce the issue.
But when I try this with the latest internal version of the controls, I do not get the Exception. So it looks like this will be fixed in the next ci build or service release.
However, even once that NullReferenceException is fixed, you still can't design the control, because Visual Studio gives me a different exception:
"The designer could not be shown for this file because none of the classes within it can be designed."
But it looks like this is an issue with Visual Studio and not our controls, because I can reproduce the same issue with a control that is derived from Control, instead of UltraPanel. So there's nothing we can do about that.
So it appears that the VS Designer will only allow you to design certain classes like UserControl or Form and not classes that are derived from Control or other base classes like they do in DotNet Framework applications.
I'm confused. Neither UltraPanel, nor the UserControl, nor the derived UltraPanel control have an option for "View Designer" on the context menu. I tried the "About" and "Custom Property Page" options, which are the only ones specific to UltraPanel that we provide and they are both working fine for me, at least with our latest internal build.
Am I missing something?
EDIT: Just to be extra thorough here, I tried it again with v21.1.32-ci and I still do not see a "View Designer" option on the context menu.