07-18-2014 07:41 PM
I was working fine using Visual Studio 2013, Dot Net 4.5.1, NI.Common 13.0.40.190, NI.DAQmx 9.9.45.39, and NI.NI4882 13.0.45.159. I need to support XP machines so I downgraded to Dot Net 4.0. I redefined Dot Net in the solution and restarted only to get NI488.2 errors indicating that NationalInstruments.NI4882 namespace doesn’t contain any public members or cannot be found and undefined name errors like: NI4882.Device, NI4882.SerialPollFlags, NI4882.TimeoutValue, NI4882.NotifyData, NI4882.GpibStatusFlags
There were about 15 errors when the debugger was opened but it jumped to 45 when build was executed. I got rid of the initial debugger errors by changing all NationalInstruments.NI4882. references to just NI4882. references. However, when I build, my 45 errors come back. I tried going back to Dot Net 4.5.1 and also removing the NI488.2 reference and adding it back in but the errors persisted.
Any Ideas?
Solved! Go to Solution.
07-21-2014 05:15 PM
Hi DaDud,
What version of NI 488.2 do you currently have? Can you post the exact error message that you are seeing?
07-21-2014 07:08 PM
I believe that I found the problem. There was a warning message hiding that stated:
Warning 1 The primary reference "NationalInstruments.NI4882, Version=13.0.45.159, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
So, apparently this version of NI488.2 does not work with .Net 4.0. even though the manual for this version states on page 4-2
NI-488.2 Application Interfaces
You can use an application interface if your program is written in Microsoft
Visual C/C++ (6.0 or later), Borland C/C++ (5.02 or later), Microsoft
Visual Basic (6.0), or any .NET programming language. Otherwise, you
must access the dynamic link library directly.
So then the question is: What is to most recent version of NI488.2 that works with dotNet 4.0 and what versions of Common and DAQmx should be associated with that version?
07-21-2014 09:08 PM
@DaDud wrote:
I believe that I found the problem. There was a warning message hiding that stated:
Warning 1 The primary reference "NationalInstruments.NI4882, Version=13.0.45.159, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
So, apparently this version of NI488.2 does not work with .Net 4.0. even though the manual for this version states on page 4-2
NI-488.2 Application Interfaces
You can use an application interface if your program is written in Microsoft
Visual C/C++ (6.0 or later), Borland C/C++ (5.02 or later), Microsoft
Visual Basic (6.0), or any .NET programming language. Otherwise, you
must access the dynamic link library directly.
So then the question is: What is to most recent version of NI488.2 that works with dotNet 4.0 and what versions of Common and DAQmx should be associated with that version?
It states very clearly that you need to change the currently targeted framework. Do you even understand what that means????
07-23-2014 12:39 PM
I asked a question and so far the only answer I have received is flames that I consider unprofessional, immature, and a cheap shot. So I will rephrase the final question.
This software runs on several fixtures of which two are still on Windows XP computers that cannot be upgraded at this time. Since Windows XP won’t support a .Net framework higher than 4.0, I need to downgrade my software from .Net 4.5.1 to .Net 4.0. The latest version of NI488.2 was compiled under .Net 4.5 and will not run under 4.0. So my questions are:
07-24-2014 04:14 PM
Hi DaDud,
Check out these two knowledge base articles:
Why am I Getting Missing Namespace Errors In My .NET Project?
http://digital.ni.com/public.nsf/allkb/1F49C992147C063586257AF700751B40
Why Does the NationalInstruments.Common.dll Have an Exclamation Point Next to it?
http://digital.ni.com/public.nsf/allkb/46DE00265283A71586256FC000797682
Also, the readme's for the NI 488.2 will let you know which version of .NET Framework they support. Version NI 488.2 3.1.1 supports both .NET Framework 4.0 and 4.5
07-24-2014 06:10 PM
Kevin,
Thaks for your help. I checked the ReadMe for 3.1.2 (the version I have installed) and says that it supports .Net 3.5, 4.0 and 4.5 but it did not work with 4.0. So per your suggestion I will install 3.1.1 and try that. If it doesn't work, I will just keep installing older releases until I find the one that does.
Thanks again for your help. This thread can be closed.