From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Message while trying to Debug the program

Dear all,

 

I am currently using Viusal Studio 2010 on Windows 7 64-bit to make Equipment control via NI VISA/488.2.

I have updated my NI 488.2 to the latest version and NI MAX is 14.0.0.f0

 

Currently I have made some code and using 2 references

NationalInstruments.Common.Native.dll  - 13.0.40.190

NationalInstruments.VisaNS.dll - 13.0.40.167

 

I am experiencing an error which I cannot carry on my debug of the program

Below are the messages:

 

  • Error    1    The type 'NationalInstruments.ISupportSynchronizationContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298'.   
  • Error    2    The type 'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298'.

I don't have 13.0.40.188 version of NationalInstruments.Common, I only have the latest one which is 13.0.40.190

Is there anything that I can do in order to make it re-direct to the latest version?

 

Thanks

Kevin

0 Kudos
Message 1 of 7
(5,409 Views)

Hello Kevin, 

 

NationalInstruments.Common.dll can be installed with multiple National Instruments programs, so first, I would suggest checking that your newest version of NationalInstruments.Common.dll is associated with Measurement Studio 2013. I would also check that there isn't a newer version associated with another software component, just to be sure.  To do this, go to the computer that has this version fo the DLL and go to NI MAX by going to "Start" and typing in "NI MAX" into your search bar and selecting the program of the same title. Once open, expand the "Software" node in the left pane. This will display a list of National Instruments software on your computer. Next, you can expand each node. After doing this, if you see a "DotNET" node, expand this as well. This will list the .dlls associated with this product. Selecting the .dlls will display the version in the right pane. 

If you find the DLL is associated with Measurement Studio 2013, then please look at the following directions. If not, please reply with what you find.

There is no direct way to install this DLL. However, you might be able to update it tangentally by repairing and modifying your installation of Measure. To modify or repair an installation, go to Start->Control Panel->Uninstall a program. From there, select "National Instruments Software" and click "Uninstall/Change." This will bring you to the modify and repair options. I would start by modifying the installation. To do this, I would select your version of Measurement Studio and click "Modify." Make sure that .NET Framework 4.5 Language Support is selected as an option. If this option is not available, please download it from the site listed below and then try adding it in the modification. If this is still not possible, next try to repair the software following the same procedure. If the repair does not resolve things, you might try reinstalling altogether. To uninstall, choose the "Remove" option from the Modify/Repair screen. 

Microsoft .NET Framework 4.5 
http://www.microsoft.com/en-us/download/details.aspx?id=30653 ;

Best wishes!

Amanda B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(5,386 Views)

Hi Amanda,

 

I have tried to uninstall all my NI software and re-install NI488.2 v14.0 with .NET framework 4.0 & 4.5 Support.

Now my program can debug but still has those two error messages. I have tried to install .NET framework 4.5.1 developer pack but it's only available for Visual Studio 2012.

 

Now I am encountering these errors:

 

Warning    3    The currently targeted framework ".NETFramework,Version=v4.0,Profile=Client" does not include "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which the referenced assembly "NationalInstruments.Common, Version=13.0.40.190, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=MSIL" depends on. This caused the referenced assembly to not resolve. To fix this, either (1) change the targeted framework for this project, or (2) remove the referenced assembly from the project

 

Error    1    The type 'NationalInstruments.ISupportSynchronizationContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298'.

 

Error    2    The type 'NationalInstruments.ISynchronizeCallbacks' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298'.

 

But I am able to continue to debug my program using the latest driver for VisaNS and Common.dll

 

Thanks

Kevin

0 Kudos
Message 3 of 7
(5,368 Views)

You may be able to get rid of the errors concerning NI dll's by setting the 'Specific Version' flag to false for those two references. In Visual Studio, select one of the references in question. Then, in the properties window, set the 'Specific Version' flag to false. Then do the same change for the other reference.

This should get rid of the error unless there is a code breaking change in the dll.

0 Kudos
Message 4 of 7
(5,357 Views)

Thanks dwk,

 

I have set both dll "Speific Version" to be false but I still have those 2 errors.

I have no idea why I cannot use .NET framework 4.0 to run the latest dlls.

 

I am thinking if it's .NET framework problem with the latest dlls as I assume these latest dlls need .NET framework 4.5 to work.

Therefore it prompts up and ask me to use 13.0.40.188 rather than letting me to use 13.0.40.190 instead.

 

Thanks

Kevin

0 Kudos
Message 5 of 7
(5,342 Views)

I just realized that you are using the framework client profile. You must use the full profile for the NI stuff to work.

0 Kudos
Message 6 of 7
(5,337 Views)

Thanks, I have changed to .NET framework 4.0.3 and now I think it's working fine without any prompt/error

 

Thanks

0 Kudos
Message 7 of 7
(5,315 Views)