Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

System.MissingMethodException for NationalInstruments.Visa.Session

I am getting the following error in a .NET application running on Windows 10 64-bit

 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Constructor on type 'NationalInstruments.Visa.Session' not found.
   at Ivi.Visa.GlobalResourceManager.Open(String resourceName, AccessModes accessModes, Int32 timeoutMilliseconds, ResourceOpenStatus& openStatus)

(shortened to remove my application specific methods).

 

I have the same SW components installed on another PC (though Windows 7 32-bit) that is working just fine.

 

I am trying to understand what I might be missing. I looked at the NationalInstruments.Visa.dll in the GAC and the Session constructor is internal, so I am not sure why the Ivi.Visa code is trying to call an internal method in the first place.

 

Has anyone seen an issue like this before?

0 Kudos
Message 1 of 3
(2,288 Views)

Hi slide_o_mix,

You may want to check through the NI VISA readme and see if you're using the minimum required versions of .NET Framework.

You can find readme files of each VISA driver at the download link below:

NI-VISA

https://www.ni.com/en-us/support/downloads/drivers/download.ni-visa.html#306031

This information will usually be under the section titled something like "Application Software Support"

Jiwhan S.
Technical Support Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,232 Views)

Hi Jiwhan,

 

I am using the correct versions of the .NET Framework. After more debug, I think I am having an issue with the VICP transport from Lecroy so I will follow up with them. Basically what I am seeing is that the resource string is parsed and comes back with "Custom" as the interface type instead of Tcp. Eventually, I believe the .NET classes call viParseRsrcEx which is a native function, I am not sure how this ties in with the VICP transport, or what is missing there, but the return of type "Custom" causes the instantiation of the session return Session for the type instead of a valid session implementation (e.g., TcpipSession) and Session doesn't have a constructor (because it's an internal constructor). I will update this issue with any findings just in case it will be useful to someone in the future.

 

Thanks,

 

Alex

0 Kudos
Message 3 of 3
(2,210 Views)