Unable to cast, opening control in designer fails

Answered
0
0

Hi all at Wisej,

please fix this annoying error.

When trying to open form or page or usercontrol, sometimes the designer does NOT open it, and it says “Unable to cast from NNN to IWisejControl, see attached screenshot. Then, after closing VS2019 and reopening it, problem is magically self-fixed. Well, I dont want to restart the VStudio many many times a day. Can you please have a look on it?

 

Thanks

Pavel Weiss

  • You must to post comments
Best Answer
0
0

It is caused by Visual Studio designer loading an assembly used at design time more than once (copied to a shadow file). It usually happens when there are multiple versions or a custom component is used at design time and the assembly is recompiled.

It’s a known issues/features if Visual Studio and it’s most likely caused by the solution configuration in terms of references and custom controls. We work with solutions with more than 120 projects each and thousands of controls and managed to minimize this issue.

It’s not a Wisej issue. The error occurs before Wisej is even loaded by the designer and there is nothing for us to fix.

You can find several explanations and approaches here:

https://www.telerik.com/forums/invalidcastexception-on-displaying-radgrid-in-designer
https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/27019/unable-to-cast-object-of-type-infragistics-win-checkboximageglyphinfo-to-type-infragistics-win-glyphinfobase#

https://wisej.com/support/question/unable-to-cast-object-of-type-wisej-web-form-to-type-wisej-core-iwisejcontrol-when-re-opening-wisej-project

 

 

 

 

 

 

  • You must to post comments
0
0

It has nothing to do with adding wisej packages to project, nor adding anything new to the project. I just open existing solution, and, sometimes it shows the designer fine, sometimes not. It compiles without build errors all the time.

Thanks,

Pavel

  • You must to post comments
0
0

Hi Pavel,

Does it happen all the time (i.e. when you add a new Page or Window) or only when you add Wisej’s package to a project?

Best,
Alaa

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.