02-27-2023 04:27 PM - edited 02-27-2023 04:35 PM
Hi Experts..
I want to use the TS controls in Visual Studio 2022 .NET 6.0
I added the "NationalInstruments.TestStand.API -Version 22.0.0-dev.9" package correctly via NuGet. and then a list of controls “UI.AxControls” appears correctly in the toolbox. However, when I place one of these controls in the MainForm, the application crashes and the form does not display properly. And I got this msg when I run the app : (System.Runtime.Serialization.SerializationException: 'Unable to load type System.Windows.Forms.State required for deserialization.')
Additionally, I observed that the resource file associated with this form is not generating the correct parameters. For example, if I place the "axApplicationMgr" control in the form, the data generated in the resource file will be:
However, what I am expecting to obtain is something like this:
Is there anyone who can help me with this?
01-11-2024 12:13 AM - edited 01-11-2024 12:34 AM
Hi MiMou1984,
This is very likely because Microsoft has not implemented design time support for ActiveX controls in .NET Core. See this feature request. Up-voting this might(fingers crossed) help getting this feature implemented.
I did notice that if you have a .NET framework project with Windows.Forms that use ActiveX controls and we upgrade the project to .NET core, then the project does build and execute correctly. The issue arises if you edit the form in the Visual Studio designer in any way, then the resource (.resx) file gets messed up. Based on this, the workaround suggested in this blog might be something worth trying.
Regards,
Tinu