LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET constructors don't show up in LV 8.5

I just installed Labview 8.5 and I had a program that was calling a >NET assembly.  After installing 8.5 the vi was broken and the .NET assembly got an error trying to load the assembly.  So I removed all the references and shut down labview.  I then re-opened the vi and put a constructor node down, and went to select my >NET assembly, and it came up just fine, so I went to the class I need, but no constructors appear.  I have tried re-compiling the .NET assebly, and I still got nothing.
 
Any ideas?
 
Thanks,
 
Brad
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 1 of 20
(4,873 Views)
Hi Brad,

Add your LabVIEW VI that uses the .NET assembly to a LabVIEW project and then put all assemblies you will be referencing in the project directory or subdirectory.  It is recommended to add your VIs that use .NET assemblies to a LabVIEW project.

Try that out and let me know what happens!

Best Regards,


Jonathan N.
National Instruments
0 Kudos
Message 2 of 20
(4,872 Views)
It is already in a project with the other dlls that it uses.  It is just the same project as I had for 8.2.1, which it where it was working before. 
 
The dlls, are in the same folder on my computer, but in different "folders" in the project.  I can try putting them together and see if that helps.
 
...  Nope that didn't help.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 3 of 20
(4,873 Views)
I have seen something similiar.  In that, at home on my laptop running 8.5 I got no constructors for a .net dll, but at work (using 8.5), it worked fine.  I copied the DLL from home and brought it to work, so that was not the issue and in transporting it home, The app was broken.  I got it working merrily at work, and I forgot to ask about it, till you brought it up.

Paul
0 Kudos
Message 4 of 20
(4,871 Views)
I just created a new project and only put in the dlls.  Then I created a new vi and tried to load the assembly, and it worked.  So my question is:  What chenged from 8.2.1 to 8.5 that would break this?  What can I do to get it all working again?
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 5 of 20
(4,874 Views)

Hi remenankb,

I am still a little confused as to what works and what doesn't. So in LabVIEW 8.5, if you

1) Add your VI that uses a .NET assembly to a LabVIEW project
2) Move your .NET assemblies to the same directory as the project or a subdirectory
3) Open the VI and try and browse for the constructor via the .NET Constructor Node

Does that work? This should work.

Our end goal with regards to .NET integration is follow the .NET model in terms of how assemblies are located and where they should be placed.  The .NET CLR requires that assemblies live either in the GAC or the same directory, or subdirectory of the application so that it can locate them at run-time.  LabVIEW addresses this requirement by creating a separate AppDomain for the LabVIEW project and setting the AppBase to the home directory of the LabVIEW project. This allows the .NET CLR to locate the assemblies.  That is why we recommend using LabVIEW projects.  You can find out more information on how LabVIEW finds assemblies in the help topic Using .NET with LabVIEW.

Now in LabVIEW 8.5, we did change a few things (i.e. trying to move closer to .NET model) underneath with regards to our loading mechanisms.  If you have been using LabVIEW projects already and putting your private assemblies in the locations I mentioned (i.e. project directories), you should have been fine. If you are not, I am sorry for the inconvenience. 

Now if these suggestions don't work, I would be happy to try out loading your assemblies on my side. I want to make sure our .NET integration is a smooth as possible.

Hopefully this makes some sense.

Best Regards,

Jonathan N.
National Instruments
Message 6 of 20
(4,873 Views)

I found out what is causing the main issue.

If I have the Dlls in the same directory on disk as the project then the constructors will load.  But if the project (.lvproj) file is in a directory above the Dlls (mine was 4 directories higher) then the constructors dont load.

Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 7 of 20
(4,858 Views)
Jonathan,
 
I'm having the same issue.  Adding to a project didn't help at all, with or without the assemblies in the same directory. 
 
I have one assembly that LV 8.5 can't even see any available constructors, but 8.2.1 works fine.    I tried this with existing VI's and new VI's.  I'd be happy to send you a copy of the dll.
 
In the meantime, I'd prefer to revert back to 8.2 until this gets fixed.
 
Rich Higgins
 
0 Kudos
Message 8 of 20
(4,847 Views)
Hi Rich,

Yeah, if you have a .NET assembly in which LabVIEW can't see the public constructors, I would be happy to take a look at it. Especially if the project scenario didn't help you at all.

Just post that assembly (and of course any dependent assemblies that might define entities used in the top-level assembly).

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 9 of 20
(4,844 Views)
Jonathon,
 
Can I get you email address?  I'd prefer not to post this dll to the public.
 
 
 
Rich Higgins
 
 
higgins  (a)  ieee  dot  org 
0 Kudos
Message 10 of 20
(4,839 Views)