Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

I get a TypeLoadException WaveformPlot in Measurement Studio for Visual Studio 2005

Solved!
Go to solution

MSError.jpg

 

Thanks,

Greg Filis

0 Kudos
Message 1 of 18
(8,538 Views)

Greg,

 

There are several possible causes of this error, but the Visual Studio help gives the following as an explanation:


TypeLoadException is thrown when the common language runtime cannot find the assembly, the type within the assembly, or cannot load the type.

 

In order to help you diagnose the error, could you please provide me with a little more information about your code that is throwing the error. Maybe if you could post the specific line in the code where it fails and the relevant surrounding code. Also, if you could provide a brief explanation of what you expect the code to do.

National Instruments
0 Kudos
Message 2 of 18
(8,520 Views)

I get the failure message on the InitializeComponent() call in the constructor for my form which has a waveformGraph control on it.  It doesn't even step into the InitializeComponent() function.  I have tried putting a breakpoint on the first line of the function, but it never gets there.  If I delete the waveformGraph control everything runs fine.

 

 

public SPCForm()

{

   InitializeComponent();

 

Greg

0 Kudos
Message 3 of 18
(8,509 Views)

Greg,

 

It sounds like one of the .dll files for Measurement Studio is missing or in an unexpected location. Check to see if you can find the NationalInstruments.UI.WindowsForms.dll on your computer. The default installation location is: C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Assemblies\Current\NationalInstruments.UI.WindowsForms.dll

 

What happens if you recreate the object on your form? It is possible that some of the linking for that component was corrupted.

National Instruments
0 Kudos
Message 4 of 18
(8,501 Views)

The dll is there, I can't tell if it is corrupt.  I can insert the waveformGraph from the Toolbox and set it up just like on the other machine, but I get the error if I try to run the app.  I go in and delete the waveformGraph and it runs fine (it compile ok either way).

0 Kudos
Message 5 of 18
(8,499 Views)

Do you have any other Measurement Studio objects in your application? If not can you add one and see if it will run. It is hard to figure out what is causing this issue without having your project to look at. Could you attach the project, or make another project that reproduces the same error?

National Instruments
0 Kudos
Message 6 of 18
(8,473 Views)

No I didn't, so I tried to add a gauge and got this:

 

GaugeError.jpg

0 Kudos
Message 7 of 18
(8,459 Views)

Greg,

 

1. What version of Measurment Studio are you using?

 

2. It is possible that the controls were not properly registered with Visual Studio. Try the following commands in the Windows command prompt:

 

regsvr -u "waveformplot.ocx"

regsvr "waveformplot.ocx"

 

or

 

regsvr -u "guage.ocx"

regsvr "guage.ocx"

 

These commands may or may not work.

 

3. Since Visual Studio is having trouble locating your files, it looks like your installation of Measurement Studio is in someway corrupt. I would recommend doing either a repair installation or a clean reinstall. You can do both of these by running the setup.exe on the Measurement Studio disc.

 

Let us know if this works.

National Instruments
0 Kudos
Message 8 of 18
(8,428 Views)

Greg,

 

I apologize, but step 2 that I posted previously is not a valid troubleshooting step. Instead, let's build a fusion log. Check out nickb's blog on Using Fusion Logs to Debug .NET Assembly Binding.Issues. This should give us a very good idea where the problem is located.

National Instruments
0 Kudos
Message 9 of 18
(8,418 Views)

OK, I ran fuslogvw.exe and got the following log file for NationalInstruments.Common:

 

*** Assembly Binder Log Entry  (11/1/2010 @ 7:20:39 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\source\Spotlight\Code\!Executables\Spotlight.SoftFrontPanel.vshost.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = HARRIS\gfilis
LOG: DisplayName = NationalInstruments.Common, Version=8.1.20.235, Culture=neutral, PublicKeyToken=4544464cdeaab541
 (Fully-specified)
LOG: Appbase = file:///C:/source/Spotlight/Code/!Executables/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Spotlight.SoftFrontPanel.exe
Calling assembly : Microsoft.VisualStudio.HostingProcess.Utilities, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\source\Spotlight\Code\!Executables\Spotlight.SoftFrontPanel.vshost.exe.Config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Redirect found in application configuration file: 8.1.20.235 redirected to 8.5.20.149.
LOG: Post-policy reference: NationalInstruments.Common, Version=8.5.20.149, Culture=neutral, PublicKeyToken=4544464cdeaab541
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/source/Spotlight/Code/!Executables/NationalInstruments.Common.DLL.
LOG: Attempting download of new URL file:///C:/source/Spotlight/Code/!Executables/NationalInstruments.Common/NationalInstruments.Common.DLL.
LOG: Attempting download of new URL file:///C:/source/Spotlight/Code/!Executables/NationalInstruments.Common.EXE.
LOG: Attempting download of new URL file:///C:/source/Spotlight/Code/!Executables/NationalInstruments.Common/NationalInstruments.Common.EXE.
LOG: All probing URLs attempted and failed.

This was the only one that said the operation failed.  I'm not sure what to do to fix this.  Please tell me what I need to do to correct this problem.

 

Thanks,

Greg

0 Kudos
Message 10 of 18
(8,340 Views)