06-01-2015 03:26 PM - edited 06-01-2015 03:43 PM
I'm using VS 2013 with Measurement Studio 2013. I know that there is no VS 2013 integration supported, but that's fine and so far I have been able to work around that using the suggested methods (e.g. manual licx file generation). However, I'm now running into an issue which I fear is a Visual Studio bug (and not a problem with NI), but I'm wondering if anyone else has faced this.
Prior to today, I had a perfectly working Windows Forms project with a single form. This form included some NationalInstrument.UI.WindowsForms.WaveformGraphs. For some reasons, and I don't know what changes caused this, when I open the VS Designer to this form, I now am faced with an error screen listing 3 errors. They are all of the same form, and say:
Could not find type 'NationalInstruments.UI.WaveformPlot'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
For the other two errors, the WaveformPlot type is changed to XAxis and YAxis. The project is referencing the correct libraries (NationalInstruments.UI, NationalInstruments.Common, and NationalInstruments.UI.WindowsForms) and I'm building in x86 and referencing only the x86 versions of the libraries. After all, this was all working before with seemingly no changes.
I even went back to previous checkpoints within our source control tree, that I know with certainty were building before, but the error persists.
I've seen behavior like this in VS before and sometimes you can remedy the situation by a combination of black magic, for example cleaning, deleting bin and obj directories, rebuilding, re-starting etc., however in this situation, none of those things seem to work. I'm pretty experience when it comes to VS and Windows Forms development and have tried most of the solutions you might first think of, so I'm looking for someone who has been in this situation before. Thanks!
Solved! Go to Solution.
06-01-2015 03:59 PM - edited 06-01-2015 04:11 PM
I forgot to mention that the program compiles without errors and I am able to run the program and the form displays perfectly, including the NationalInstruments WaveformGraph controls. This is only an error in the VS Designer.
Also, it's happening now for the National Instruments Examples that ship with the Developer Suite as well. This seems like a fairly wide-ranging problem. I'm wondering/fearing whether I need to resolve this by wiping the machine and re-installing everything (Visual Studio, NI, etc.).
06-02-2015 07:55 AM
06-02-2015 08:46 AM
Thank you. I ended up uninstalling and re-installing Measurement Studio, which seems to have worked, but I do believe the thread that you referenced indiciates the root cause. This may have started happening after I applied some updates from NI.
If it happens again in the future, I will take the steps outline in that thread.
06-17-2015 04:02 PM
Please see the following KB for details on fixing this problem: Could not find type Errors in Visual Studio Designer.
Thanks,
Daniel
03-10-2020 11:44 AM
I had a very similar problem with my Ax GUI controls in a Visual Studio 2019 project. When the designer tried to open I got errors like "Could not find type 'NationalInstruments.TestStand.Interop.UI.Ax.AxSequenceView'", but the application built and ran perfectly. I think this happened after installing a VS update or possibly SP1 of TestStand 2017.
With VS2019 the KB referenced in Daniel's post is not applicable, instead the solution I found was to copy NationalInstruments.TestStand.Interop.UI.AxControls.dll from my TestStand installation:
C:\Program Files (x86)\National Instruments\TestStand 2017\API\DotNET\Assemblies\CurrentVersion
to
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.TestStand.Interop.UI.AxControls\<registered version>
In my case <registered version> is v4.0_17.1.0.130__ad9244eb3b825cd8, at least that's where Visual Studio looked for it even though the DLL I copied is actually version 17.0.0.184