08-08-2012 04:42 PM
Hi,
I have an application built in VS2005/C# and Measurement Studio 8.1(which is for VS2005 and .NET2.0), everything works fine on my development PC, and I built the installer from VS2005, which also works. But when I deployed the app on target machine, the application cannot run and throw a "null reference exception" error on the NI.Common.dll while all other NI dlls seem fine.
The dll modules I used:
NI.Analysis.Enterprise.dll
NI.Common.dll
NI.UI.dll
NI.UI.WindowsForms.dll
And the merged module that automatically associated in the setup are:
mstudiocommon.2005.msm
mstudiodesign.2005.msm
mstudioui.2005.msm
mstudiouiwinforms.2005.msm
msvcrt.msm
nimesadll.msm
nimetautils.msm
Development and Target PC both runs Windows7, and .NET 2.0, .NET Compact 2.0, and .NET 4.0. The application is set to x86 platform.
Also I notice that after installation on Target PC, under the program folder, there's no NI.Common.dll while others existed. Attached is the error report from Windows Eventviewer when I try to run the app on the Target PC.
Thank you.
Solved! Go to Solution.
08-09-2012 04:04 PM
Hello Xinchen,
What if we manually put the NI.Common.dll onto the target computer? this could solve the problem. Also have you tried deploying to a second computer? Lets try that and see what happens!
http://digital.ni.com/public.nsf/allkb/46DE00265283A71586256FC000797682?OpenDocument
http://digital.ni.com/public.nsf/allkb/BEDA0D4A341FB1C3862572C70045CF40?OpenDocument
Daniel
08-09-2012 04:45 PM
Hi Daniel,
Copying the dll over manually doesn't work. I did try to deploy to other computers, all don't work.
But I do notice that it works on my another development PC, which though doesn't have any NI installed right now, but does have many different versions of NI dlls in the GAC(remaining from previous NI product installation I suppose), also another interesting thing is after I uninstalled all un-related version of NI.Common.dll from GAC(leaving the only one used in app: 8.1.20.235), the app stopped working.
Is it possible that VS2005 somehow compiled newer version of NI.Common.dll in the GAC instead of the one I indicate in the application? I did checked the reference settings, and tried to set "local copy" of NI.Common.dll to both true and false and make sure the version is correct. But what happened in that PC is weried.
08-09-2012 05:01 PM
Hello,
Fair enough, it looks like the installer is not correctly including the NI.Common.dll. How about before we start trying some super in depth troubleshooting let's repair Measurement Studio on your developing computer and try rebuilding the installer. this will check a lot of possible smaller errors that may be hiding in your code. In the mean time I will check my sources and see what additional information I can come up with!
To repair Measurement Studio » Open Control Panel » Programs and Features » National Instruments Software » Measurement Studio » Repair.
Daniel
08-10-2012 10:29 AM
Just an update, Repairing the NI Mesaurement Studio didn't work out for me.
08-10-2012 10:40 AM
Another update:
I think my susception was right, I tried to unintall the NI.common.dll in the GAC for version 9.1.20.163(highest version in the GAC, the version I specified in the app is 8.1.20.235), which is not used in this application,and the app crashed immedately.
I guess somehow the app try to use the highest version of NI.Common.dll no matter what version I specify in the app. (Even the Specific Version property is set to be true).
Any idea how to solve this and make sure the linking is correctly?
08-13-2012 10:52 AM
Hi Daniel,
Problem solved, Turns out my guess was right, the .Common dll always link to the newest version available in the GAC,(policy dll?) no matter which one I specify in the application.
So I just uninstalled all NI related dlls in the GAC, and reinstall the version I am using, and do a recompile, then all worked out.
Thank you for the help.