01-28-2019 10:41 AM
This is a follow-up to the question asked here. How do I go about including a reference to the NI-VISA .NET API in my Visual Studio 2017 C# project? My earlier projects have used VisaNS.dll, but I gather from the documentation that this has been deprecated in favour of the .NET API.
It would be helpful if someone could go through in detail the steps involved in downloading the new API (if necessary) and adding a reference to it in a C# project. All the documentation I can find on this site still refers to VisaNS.dll.
Solved! Go to Solution.
01-30-2019 03:40 AM
Hi,
You need to reference assembly "Ivi.Visa" to use the new "IVI-compliant NI-VISA .NET API". See here for more info and the differences between NI VISA .NET and VisaNS API.
Regards,
Kelly
01-30-2019 06:37 AM
Kelly, thanks. There appears to be a link missing from your message.
01-30-2019 06:40 AM
My apologies, below is the link:
01-30-2019 07:03 AM
Kelly, thanks.
That page links to this page, which states (in Part 3) that the NI-VISA .NET API is "included in the driver installer". I assume that this is the standard installer for NI-VISA. Where do I find the Ivi.Visa library, after installing NI-VISA? If I select ".NET 4.5 Development Support" in the NI-VISA installer, that just installs the old VisaNS.dll.
01-30-2019 11:23 AM
IVI.Visa dll is installed here: C:\Program Files (x86)\IVI Foundation\VISA\Microsoft.NET\Framework32\v2.0.50727\VISA.NET Shared Components 5.8.0
It should also show up in Visual Studio references see attachment.
01-30-2019 11:52 AM
cymrieg, thanks.
Perhaps I should have asked this question earlier - what's the first version of NI-VISA to include the .NET API? It may just be that I don't have a new enough version.
01-31-2019 08:47 AM
according to this 15.0: http://download.ni.com/support/softlib//visa/NI-VISA/18.5/Windows/readme.html
01-31-2019 08:51 AM
cymreig, thanks. I have 15.5 installed on my system, so that isn't the problem. I'll try uninstalling VISA altogether and re-installing it.
02-06-2019 12:58 PM
Just a quick note to let everyone know that reinstalling NI-VISA fixed the problem. The required element is .NET 4.0 - 4.5.1 Development Support (IVI). For some reason, this didn't come up in the "Modify" menu from Control Panel.