Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NationalInstruments.Controls.Graphs.dll System.IO.FileNotFoundException

Solved!
Go to solution

Hello,

 

The application that I am working on contains some plotting. All the functionality works fine on my machine. However, when I build in release mode, and then test on another machine (have tried all targets, x86, x64, and any CPU), the application crashes. The graph seems to load fine, but it seems like the crash is occuring when data is supposed to be added to the plot.. Looking into the crash dump, I can see the following error coming up

 

Capture.PNG

 

There are not references to SharpDX in my project, and I assuming this dll is being used by Graphs.dll. How can I resolve this issue?

 

Thanks

0 Kudos
Message 1 of 9
(6,423 Views)

Hi Jstella,

 

What version of Measurement Studio do you have installed? What version of Visual Studio do you have installed? What is the software configuration of the other machines? Do the other computers have any NI software installed? 

 

Are you creating an executable? What kind of graph are you using? 3D? Do you have other controls other than the graph? Do those throw an exception?

JD B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(6,367 Views)

Hi JD

 

Thanks for the response.

I am using Measurement Studio 2015 on visual studio 2013. The other machines are x64, and do not have measurement studio installed, or any other NI software. In the past, I have just packaged the measurement studio dlls which worked fine with things like Winforms.

I am currently running the project in release mode, and then copying the bin folder, as I wanted to test before creating an installer. Running the software from visual studio on my machine works fine.

 

I am using a standard 2D graph:

 <ni:Graph.Plots>
                <ni:Plot Label="Plot W">
                    <ni:LinePlotRenderer Stroke="{Binding PlotLineColor1}" StrokeThickness="2"/>
                </ni:Plot>
                <ni:Plot Label="Plot X">
                    <ni:LinePlotRenderer Stroke="{Binding PlotLineColor2}" StrokeThickness="2"/>
                </ni:Plot>
                <ni:Plot Label="Plot Y">
                    <ni:LinePlotRenderer Stroke="{Binding PlotLineColor3}" StrokeThickness="2"/>
                </ni:Plot>
            </ni:Graph.Plots>
        </ni:Graph>

on the CS side I am binding data as follows:

  mCtrl.Dispatcher.Invoke(new MethodInvoker(delegate
            {
                MyModel1[0].Append(last.X);
                MyModel1[1].Append(last.Y);
                MyModel1[2].Append(last.Z);

            }));

the data is being bound via an event. 

I believe the problem that causes the program to crash happens here.

 

 

Like I said, this all works fine from Visual Studio, and I do not get any exceptions thrown.

 

please let me know if there is a resolution to this issue. Thanks very much

 

0 Kudos
Message 3 of 9
(6,364 Views)

Hi JStella,

 

I will need to look into this further. Nothing jumps out at me . I will get back to you when I have more information.

JD B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(6,286 Views)

Thanks JD,

 

Let me know if I can provide further information in order to get this issue resolved.

 

Joe

0 Kudos
Message 5 of 9
(6,276 Views)

Hi JD,

 

Just to follow up, were you able to find anything out about the graphing exception I reported?

 

I also ran some more tests on my end, and other WPF controls (Gauge,Meter) from NI seem to be working fine when using a release build. It seems to be a problem directly related to the WPF plot class.

 

Thank you,

 

Joe

0 Kudos
Message 6 of 9
(6,231 Views)

Hey Joe,

 

After looking into this further I would that SharpDX is a .NET wrapper for DirectX API. It is primarily used for graphics and potentially for the graphics on the graph. It is built for .NET 4.0. Do you know what version of .NET you are using on each computer (development/deployment)? As a sanity check: Are you by chance using any other third party software that may call SharpDX?

 

Did you set a break point to verify when the exception is thrown?

JD B.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 9
(6,209 Views)
Solution
Accepted by topic author Jstella

The SharpDX*.dll assemblies are used by the WPF to support DirectX rendering. This was a new feature introduced in Measurement Studio 2015. There are 6 assemblies, and they are only in the GAC:

  • SharpDX.D3DCompiler.dll
  • SharpDX.Direct3D9.dll
  • SharpDX.Direct3D10.dll
  • SharpDX.Direct3D11.dll
  • SharpDX.dll
  • SharpDX.DXGI.dll

These are in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\SharpDX* folders (each assembly has it's own folder). If you copy these and put them in the same location you run your executable from, they should run fine.

 

The new Installer Builder that comes with Measurement Studio 2015 will also handle this automatically.

 

Message 8 of 9
(6,187 Views)

Yeah, I had traced the problem back to those folders, but didn't think to include those dlls in the exe directory. 

It seems to be working now. Thanks for your help!

0 Kudos
Message 9 of 9
(6,182 Views)