06-12-2013 05:54 PM
I am building a .NET application and reference two assemblies from the Measurement Studio installation: NationalInstruments.Common.dll and NationalInstruments.VisaNS.dll
My code builds and runs fine.
However, if I turn on Code Analysis in my VisualStudio project, I get an error
CA0001 Error Running Code Analysis
CA001: Could not resolve references to NationalInstruments.Common, Version=13.0.40.168
I believe I know the reason and how to fix it. Actually, National Instruments needs to fix it.
Q: What Causes This?
Hypothesis: The NI installer for the .NET language support ships version 13.0.45.167 of the VisaNS assembly and version 13.0.40.188 of the Common assembly. The VisaNS assembly was built against version 13.0.40.168 of the Common assembly, so Visual Studio code analyis is confused because it cannot find the correct assembly.
Best Fix: NI ships these two assemblies in the support tools and makes sure that the Common assembly is the version that VisaNS was built against.
I can turn off Code Analyis in my project. This is not a great solution because code analysis catches many very hard-to-find bugs.
Here is a blog that better explains the issue and gives other workarounds http://davesbox.com/archive/2008/06/14/reference-resolutions-changes-in-code-analysis-and-fxcop-part...
But it would be nice to have the very good folks at NI issue an update (or at least test this for the next release).
06-14-2013 09:48 PM
Hello Chuck
Thanks for taking the time to look into this issue. Our customers feedback is always welcome
Regards
Mart G
12-14-2016 05:25 PM
With the workaround described, the build will be successful.
But when the application runs, it will generate a run time error
searching for "NationalInstruments.Common, Version=13.0.40.168"
Have you encountered the run time issue?
12-15-2016 03:26 PM
SL_3
This is Ali from National Instrument's applications engineering. From my understanding, this error has not occurred before.
Thank you for taking all this time to find errors in our system and finding possible workarounds.
Would you mind submitting the report under here so we can formally validate it and have it sent to our R&D Department for resolution and mentioning this forum link would also be extremely helpful.