Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

System.DllNotFoundException: Unable to load DLL 'nianlys.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Hi,

 

I have been trying to deploy my Winforms application on to a production machine. My target platform for all the projects is set to x86.

when using the intensity graph i get the below exception.

 

System.DllNotFoundException: Unable to load DLL 'nianlys.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at NationalInstruments.Analysis.Internal.s.d(Double[] A_0, IntPtr A_1, Double& A_2) at NationalInstruments.Analysis.Math.Statistics.Mean(Double[] inputData)
at KronosCameraTestApp.View.ImageDisplayPanel.getValueAtPoint(String name) at KronosCameraTestApp.View.ImageDisplayPanel.intensityGraph1_PlotAreaMouseUp(Object sender, MouseEventArgs e)

 

 

The same application works fine in Debug and Release mode on my development machine, the issue happens when i build the Release mode of my application and the Setup project. On the deployed machine I see the dll NationalInstruments.Analysis.Enterprise.dll in the Program files folder. 

 

Note: I am using the Measurement Studio 2015 for Visual Studio 2013.

 

Attached are some of the pictures which may give you some insight. Please help us to resolve this asap.

0 Kudos
Message 1 of 5
(6,915 Views)

In addition to the above issue, we are facing one more problem. Seeing the below exception.

 

System.BadImageFormatException: Could not load file or assembly 'NationalInstruments.UI.Styles3D, Version=15.0.40.49152, Culture=neutral, PublicKeyToken=dc6ad606294fc298'
or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'NationalInstruments.UI.Styles3D, Version=15.0.40.49152, Culture=neutral,
PublicKeyToken=dc6ad606294fc298' at NationalInstruments.UI.LedStyle.get_Square3D() 

 

What is the best configuration for the NI DLL's to load properly in the target machine? Do we need to build the application in x64 or x86 or AnyCPU option?

0 Kudos
Message 2 of 5
(6,900 Views)

Additionally i see the below warning error message when I build my project.

 

I am now confused what should be my projects Platform and Platform Target values in project properties.

 

Warning 156 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "NationalInstruments.UI.Styles3D, Version=15.0.40.49152, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. TestApp

0 Kudos
Message 3 of 5
(6,895 Views)

Hi BabaGoud - 

 

Take a look at these two links: 
 
 
What is the bitness of your development and target machine? 
 
"I suspect that even though the setup is for X86, the project itself is AnyCPU and thus runs as a 64bit process on 64bit systems and as a 32bit process on 32bit systems. As you said your DLL is in the Program Files (x86) folder I assume it is 32bit only, so you should compile your application explicitly as x86, too."
 
Adena L.
Technical Support Engineer
National Instruments
0 Kudos
Message 4 of 5
(6,789 Views)

Thank you Adina.

 

I was able to resolve this issue by including the merge modules into my installer project. I had to include mkl.msm and nianlys.msm merge modules which in turn I guess added the nimetautils_x64.msm as well. Also, I did another extra step which was mentioned in the below thread. 

 

It is also important to note there is something extra you must do when deploying the nimetautils merge module which is noted in the help. It states "Any deployment project that contains the nimetautils.msm merge module must include a SystemFolder entry and a ProgramFilesFolder entry in the Directory Table. To include this entry in Visual Studio, add a "System Folder" and a "Program Files Folder" as a Special Folder in the File System view of the deployment project".  Make sure you have done this. 

 

https://forums.ni.com/t5/Measurement-Studio-for-NET/Runtime-error-can-t-find-nianlys-dll-after-insta...

 

Had my setup project property TargetPlatform set as x64. 

 

As of now I am good, will be doing some more testing and get back if there is any other issue.

Message 5 of 5
(6,783 Views)