From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How Use TS-Ctrls in VS2022 .NET 6.0 ?

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:

  • Name: axApplicationMgr.OcxState
  • Type: (Nothing/null)
  • Value: (Nothing/null)

However, what I am expecting to obtain is something like this:

  • Name: axApplicationMgr.OcxState
  • Type: System.Windows.Forms.AxHost+State
  • Value: (Value cannot be displayed)

Is there anyone who can help me with this?

0 Kudos
Message 1 of 2
(851 Views)

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

0 Kudos
Message 2 of 2
(506 Views)