Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

C# Measurement Studio 7.0 Problem

I'm having a problem with C# and Measurement Studio 7.0. I have no problems running the project on my development machine, but when I put it on the production machine, the program crashes when it attempts to load a form with a national instruments control on it. I am currently converting a program that I had already written in VC++ .NET and think the problem must be with the compile or something along those lines. I had noticed that when I had written the VC++ program and would compile it, I would get AxInterop.CWUIControlsLib.dll and Interop.CWUIControlsLib.dll that would have the same date and time as my executable when if finished compiling. When I compile up the C# program, the AXInterop.CWUIControlsLib.dll and Interop.CWUIControlsLib.dll have a date of 7-23-2003 on them. Because of this, I assume the non-creation of new dll's are causing the program to fail upon loading with those controls on it.

Is there something special I need to set to make these dll's compile along with the C# code? Would this be causing my problems running on a machine that is not the development machine? Could it be that there is something else I need to load on the development machine (I am running it on the same machine that will run the VC++ .NET code properly)?

Any insight would be greatly appreciated.
0 Kudos
Message 1 of 8
(5,302 Views)
How are you deploying the application? If you are using the Visual Studio setup project, make sure to include (in addition to the Interop.CWUIControlsLib.dll and AxInterop.CWUIControlsLib.dll) the following msms, which are required for the activex user interface controls and are provided with measurement studio.

CWUI_OCX.msm
NIMesaDLL.msm
nimetautils.msm

You will also need the following Microsoft msms

Mfc42.msm
Msvcp60.msm
Msvcrt.msm
Comcat.msm
Comctl32.msm
Oleaut32.msm

The setup project should automatically detect these dependencies

These msms should ensure that everything you need to use the activex controls will be deployed correctly.

I hope this helps
Bilal Durrani
NI
0 Kudos
Message 2 of 8
(5,285 Views)
Thank you for your response. I actually was thinking that I didn't need those since I had already installed the VC++ .NET software on the product machine and everything works fine with the National Instruments controls. Therefore, I figured all the necessary files were already on the machine and registered properly.

So, I have decided that I need to make another setup for the C# project. I have done that through the Visual Studio Installer project and it auto-detected all the dependencies you have listed above. I then attempted to install the C# program on the target machine and got the error: "The installer encountered an unexpected error installing this package. This may indicate a problem with this package. This error code is 2705". I've done some looking around and it appears as if I might be missing another msi file for national instruments somewhere, but I am not sure which one at this point or why I am getting this error on the target machine. Of course, when I run the install from the development machine, everything works just fine.

I'm getting grayer by the minute.

I guess what I really don't understand is how you can have two projects (written in two different languages) that use the same controls from national instruments. One can install and run fine and the other can not (both on the same machine at the same time). Meaning.. I have already written a VC++ .NET program using National Instruments Controls and have installed them on the target machine and everything works great. Then, when I try to put the C# program on the same machine, I have so many problems. Shouldn't all the necessary files used by national instruments already be on the machine since I had installed it earlier when I put the VC++ .NET project on that machine?
0 Kudos
Message 3 of 8
(5,278 Views)
Hello,

The 2705 error you are talking about is a bug in one of the installer merge modules. It assumes that the setup project will automatically fill out all standard directories, as most stand alone installation packages do. I would suggest just adding these to the setup project by right clicking in the File tab and selecting Add Special Folder...

WindowsFolder
SystemFolder
ProgramFilesFolder

This should clear everything up.

Jeff
NI
0 Kudos
Message 4 of 8
(5,268 Views)
Thanks for the insight, but unfortunately, that did not solve the problem. I still get the 2705 error just like before.
0 Kudos
Message 5 of 8
(5,260 Views)
Update...

I just tried something for the heck of it and it gave me another clue. I have my development machine networked with the target machine, so I copied the whole project to the target machine and ran the install and it ran. Therefore, I must be missing something that needs to be with the install for the install to work.

But, the sad news is that even after the install, the program still comes up to the form, tries to load and then exits. So, the deployment still doesn't solve the original problem. I will compile a list of what I have in hopes that someone can see what I am missing.
0 Kudos
Message 6 of 8
(5,254 Views)
This is what I have for dependencies and for primary output dependencies.

Visual Studio SetUp Project

Dependencies:

AxInterop.CWUIControlsLib.dll
comcat.msm
comctl32.msm
cwui_ocx.msm
dotnetfxredist_x86.msm
Interop.CWUIControlsLib.dll
mfc42.msm
mstudiocommon.msm
mstudioui.msm
mstudiouiwinforms.msm
msvcrt.msm
nimesadll.msm
nimetautils.msm
oleaut32.msm
stdole.dll

Primary Output dependencies:

AxInterop.CWUIControlsLib version: 1.6.0.0
Interop.CWUIControlsLib version: 1.6.0.0
mscorlib version: 1.0.5000.0
NationalInstruments.Common version: 7.0.0.341
NationalInstruments.UI version: 7.0.0.341
NationalInstruments.UI.WindowsForms version: 7.0.0.341
stdole version: 7.0.3300.0
System version: 1.0.5000.0
System.Data version: 1.0.5000.0
System.Drawing version: 1.0.5000.0
System.Windows.Forms version: 1.0.5000.0
System.XML version: 1.0.5000.0
0 Kudos
Message 7 of 8
(5,252 Views)
The list of dependencies seems ok. I tested this out with a C# project using the ActiveX controls with Measurement Studio 7.1 and it seemed to deploy without any problems.

Do you have a sample project i could use to test this on my end? Or a sample installer? I'll see if I can replicate with with MStudio 7.0

Thanks
Bilal Durrani
NI
0 Kudos
Message 8 of 8
(5,241 Views)