Using LabVIEW 8.5, I am attemtping to load an assembly that uses enums that are defined in two other assemblies. The assembly that I am loading fully dereferences the enums with the name of the enum in this format: "namespace.class.enum". The referencing assembly also includes the appropriate "using" clauses, and when the referencing assembly is built, the assemblies that provide the enums are copied to the build directory of the referencing assembly.
In LabVIEW, if I start out with a blank vi, here's what happens. I place a .NET constructor node on the block diagram. I select the assembly and select the appropriate constructor. LabVIEW acts as if it has loaded the assembly, however, the constructor node does not contain the of the referenced class. I then choose "select constructor" again. I select the class, and the appropriate constructor. Finally, LabVIEW appropriately references the class that I am trying to create in LabVIEW.
Now, I save the VI, and exit LabVIEW. When I restart LabVIEW and then reload the vi, LabVIEW indicates and error with the vi by "breaking" the "go" button. If I then look at the constructor node, there is a message in the window that says, "an error occurred trying to load the assembly."
Using dbgview, I see alternately one of two different exceptions that indicate that LabVIEW is unable to find the defintion of the two different enums. Here is the exact exception message from LabVIEW as displayed in dbgview:
[2428] System.TypeLoadException: Could not load type 'SwitchScanMode' from assembly 'OCC_Adapter, Version=1.0.1.0, Culture=neutral, PublicKeyToken=9f4c5abfb8486b52'.
[2428] at System.Reflection.Assembly.GetExportedTypes()
[2428] at NationalInstruments.LabVIEW.DNReflect.ListNameSpaces(Assembly assembly, Int32 flags, LVAssemblyInfo* pAsmInfo)
[2428] at NationalInstruments.LabVIEW.CrossDomainServer.DNListClassesInAssembly(LVAssemblyInfo* pAsmInfo, Int32 flags)
So, it looks like LabVIEW is able to load the assembly at least once. So in some cases, things must be happening properly. However, once the assembly is loaded, if I save the vi, then LabVIEW is never able to load the assembly again.
Anyone else see this? Is there a work around?
Thanks.