03-23-2015 01:08 PM
Hello,
I just received my NI Measurnments Studio package and I'm trying to add a graph to my WPF C# application but I'm having issues that I haven't seen in trial examples. Prior to purchasing this package, I tweaked one of trial examples to plot my own data and it worked beautifuly. Now I tried doing the same in my own project and it builds with no errors but I get exception at InitializeComponent() when I try to run it:
"The invocation of the constructor on type 'NationalInstruments.Controls.Graph' that matches the specified binding constraints threw an exception."
This is what I have:
C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.Common.dll
C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.Controls.dll
C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.Controls.Graphs.dll
xmlns:ni="http://schemas.ni.com/controls/2009/xaml/presentation"
<ni:Graph x:Name="graph" Grid.RowSpan="2" Interactions="Pan, Zoom, ZoomIn, ZoomVertical, ZoomHorizontal, ZoomOut, PanHorizontal, PanVertical">
<ni:Graph.Plots>
<ni:Plot Label="Channel 1" x:Name="Plot1" />
<ni:Plot Label="Channel 2" x:Name="Plot2" />
</ni:Graph.Plots>
</ni:Graph>
<ni:GraphInteractionPalette Graph="{Binding ElementName=graph}" />
Nothing else behind this so I should be able to at least run it and see an empty chart, right?
Please advice.
Thank you!
Solved! Go to Solution.
03-25-2015 04:54 PM
I have the same problem in any WPF application.
Every MeasurementStudio 2013's UI element (LED, Graph, Gauge...) made XamlParseException error in WPF app of VS 2013.
Build is OK. Run-time error occurs with XamlParse Exception.
Does anybody successfully run WPF app of MeasurementStudio 2013 in VS 2013?
03-26-2015 09:25 AM
Hi kirko7,
Can you post the exception details?
Thanks,
03-26-2015 09:29 AM
I got this to work. Basically it was licening known issue in VS 2013. I had to manually added .licx file to my project. This is the email I got from NI which was very helpful:
"I notice that you are using Visual Studio 2013 with Measurement Studio 2013. Currently Measurement Studio 2013 is only officially supported by Visual Studio 2012, however several of our customer have been able to make Measurement Studio 2013 work with Visual Studio 2013. We have a KnowledgeBase article that walks through working with Measurement Studio 2013 in Visual Studio 2013. It might be good to go through this article to make sure you have followed each step: http://digital.ni.com/public.nsf/allkb/C51E3B38578FAD2786257C070069F386
It does look like you are using the correct assemblies, and we were able to test the XAML code on our side. This worked just fine, so it doesn't seem like there is anything going on with the code. Another thing we can try is to Clean Solution and Rebuild Solution in Measurement Studio. This will be a good step to make sure there are no old lingering files."
Thanks
03-26-2015 10:01 AM
Check my reply above. I'm sure you have the same issue. NI is working on VS2013 integration but for now you gotta do it manually.
03-26-2015 10:07 AM
Hi kirko7,
Thanks for posting the follow up. However, to be clear, I would not say this is a 'known issue.' Having to configure a licenses.licx
file manually is expected when using Measurement Studio with versions of Visual Studio for which integration is not supported. Please refer to the following help documentation that explains this further: Creating a .licx File Without Visual Studio-Integrated Tools.
I'm glad to hear you were able to get things up and running.
Thanks,