08-03-2011 03:17 AM
Hi,
I have moved my application from Visual Studio 2008 and NET3.5 to Visual Studio 2010 and NET4.0. Now, I'm having problems with waveforms and
references. Here is error message I got when I build and run application.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'NationalInstruments.UI.Internal.WaveformPlotElement' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'NationalInstruments.Common.Native.dll' or one of its dependencies. The specified module could not be found.
at NationalInstruments.PrecisionTimeSpan.FromSeconds(Double value)
at NationalInstruments.UI.Internal.WaveformPlotElement..cctor()
--- End of inner exception stack trace ---
at NationalInstruments.UI.Internal.WaveformPlotElement..ctor(ControlElement parent, Object obj)
at NationalInstruments.UI.WaveformPlot.CreateElement()
at NationalInstruments.UI.ControlEntity..ctor()
at NationalInstruments.UI.Plot..ctor()
at NationalInstruments.UI.XYPlot..ctor()
at NationalInstruments.UI.WaveformPlot..ctor()
at IBEKOPOWERAB.Aplikacija.CATApp.CATViewer.InitializeComponent() in D:\Development\New_workspace\DV-Win\trunk\4.0.2a\KvTeamApplication\CATApp\CATViewer.designer.cs:line 145
at IBEKOPOWERAB.Aplikacija.CATApp.CATViewer..ctor(Double[] Main1r, Double[] Main2r, Double[] Main3r, Double[] Main4r, Double[] Main5r, Double[] Main6r, Double[] Analog1r, Double[] Analog2r, Double[] Aux1r, Double[] Aux2r, Double[] Aux3r, Double[] closingCurrentR, Double[] breakingCurrentR, Double[] motionR, TipUredjajaEnum tipUredjaja, String parametri, String[] numerickiRezultati, String imeFilea, List`1 lista, DataSet numerika, DataTable dtTestInfo, Double koeficijentAnalog, String tipTransducera, String koeficijentStrujnaKlijesta, String fazaTransduceraIn, String brPrekidnihMjesta) in D:\Development\New_workspace\DV-Win\trunk\4.0.2a\KvTeamApplication\CATApp\CATViewer.cs:line 368
at IBEKOPOWERAB.Aplikacija.CATApp.catviewerParent.openDemo() in D:\Development\New_workspace\DV-Win\trunk\4.0.2a\KvTeamApplication\CATApp\catviewerParent.cs:line 190
at IBEKOPOWERAB.Aplikacija.CATApp.CATForm.btnStartTest_Click(Object sender, EventArgs e) in D:\Development\New_workspace\DV-Win\trunk\4.0.2a\KvTeamApplication\CATApp\CATForm.cs:line 2452
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
DV-Win
Assembly Version: 4.0.2.0
Win32 Version: 4.0.2
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/DV-Win.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
dvbll
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/dvbll.DLL
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
dvcomm
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/dvcomm.DLL
----------------------------------------
FTD2XX_NET
Assembly Version: 1.0.6.0
Win32 Version: 1.0.6.0
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/FTD2XX_NET.DLL
----------------------------------------
NationalInstruments.UI.WindowsForms
Assembly Version: 9.0.40.292
Win32 Version: 9.0.40.292
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/NationalInstruments.UI.WindowsForms.DLL
----------------------------------------
NationalInstruments.UI
Assembly Version: 9.0.40.292
Win32 Version: 9.0.40.292
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/NationalInstruments.UI.DLL
----------------------------------------
NationalInstruments.Common
Assembly Version: 9.0.40.362
Win32 Version: 9.0.40.362
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/NationalInstruments.Common.DLL
----------------------------------------
System.Web
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
DotNetMagic
Assembly Version: 6.0.0.0
Win32 Version: 6.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Adnan/Desktop/Release/DotNetMagic.DLL
----------------------------------------
System.Design
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
It is same with x32 and x64 machines. I have tried to build it for x86, x64 and AnyCPU platform but unfortunately without success.
In references I have included
NationalInstruments.Common
NationalInstruments.Common.Native
NationalInstruments.UI
NationalInstruments.UI.WindowsForms
Help, advice, anything please?
Solved! Go to Solution.
08-04-2011 04:18 AM
During testing I have found that even when I make project with just one form and just with waveform element on it, on Windows XP with NET4.0 full it throw an exception ( I have tested it on 3 different computers). With Windows 7 it works just fine. When i run it on XP where I have installed Visual Studio 2010, it works just fine, too. In attachment there is simple program with one form and one waveform on it and printscreen of exception message. It could be some kind of bug in MS2010?
It is quite urgent so if someone have an idea - please share it with me.
Thank you in advance.
Greetings
08-04-2011 09:22 AM
Hello -
I think you likely need to install the Microsoft Visual C++ 2010 Redistributable Package. Give that a try and let us know if it resolves things for you.
NickB
National Instruments
08-05-2011 02:57 AM
Dear NickB
I hope that someday I will have a chance to buy you a beer :). Thank you very much, you saved me. It works with MSVC2010 redist.
Greetings!