LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dependency to .NET .dll has to be resolved manually upon start

Solved!
Go to solution

Hello,

 

I have a LabView application that depends on a certain .dll to work.

This .dll is in the dependency list.

 

The application works.

 

I created an installer for the application.

I included the installer that installs the .dll file at the end of the LabView installation.

 

The installer works.

The application is created on the computer and also the .dll file is created.

 

The application does work, but asks for the path to the .dll upon every start.

Why is this?

What am I doing wrong here?

Message 1 of 6
(3,633 Views)
It sounds like the location of the DLL is different in the development environment.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(3,616 Views)
Solution
Accepted by max_

The .dll was isntalled via the same installer.

 

solution: add the .dll to the project, which will copy it to the data folder.

 

The .dll does not have to be specified by the user anymore.

The .dll is correctly used (connected hardware works as expected).

 

Downside: Applications bringing their own .dll kind of defeats the point of .dlls, that is: the same code being shared by many applications isntead of duplicating that code for every application.

 

0 Kudos
Message 3 of 6
(3,596 Views)

@max_ wrote:

Downside: Applications bringing their own .dll kind of defeats the point of .dlls, that is: the same code being shared by many applications isntead of duplicating that code for every application.


Yes, but the application still needs to know where to find the DLL.   In .NET, if you want to have a shared DLL, I believe the proper thing to do is to register it in the global assembly cache, which allows all programs to find it by name. Reading up on that should probably get you the info you want.


___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(3,587 Views)

@tst wrote:

@max_ wrote:

Downside: Applications bringing their own .dll kind of defeats the point of .dlls, that is: the same code being shared by many applications isntead of duplicating that code for every application.


Yes, but the application still needs to know where to find the DLL.   In .NET, if you want to have a shared DLL, I believe the proper thing to do is to register it in the global assembly cache, which allows all programs to find it by name. Reading up on that should probably get you the info you want.


The proper thing to do is to have a redistributable/installer that does its job placing the .dll in the right spot.

0 Kudos
Message 5 of 6
(3,583 Views)

@max_ wrote:

@tst wrote:

@max_ wrote:

Downside: Applications bringing their own .dll kind of defeats the point of .dlls, that is: the same code being shared by many applications isntead of duplicating that code for every application.


Yes, but the application still needs to know where to find the DLL.   In .NET, if you want to have a shared DLL, I believe the proper thing to do is to register it in the global assembly cache, which allows all programs to find it by name. Reading up on that should probably get you the info you want.


The proper thing to do is to have a redistributable/installer that does its job placing the .dll in the right spot.


And that right spot is indeed the GAC just as mentioned by Yair. It is the only globally accessible location in every version of .Net if you do not want to copy the assembly DLL into your application directory. LabVIEW adds to this the location of the current project file but that is about it. Individual applications can register additional directories with .Net where it should search for assemblies but that only applies for the actual application not for any other.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(3,580 Views)