07-16-2019 07:00 PM
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?
07-18-2019 04:41 PM
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"
07-23-2019 02:44 PM
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