03-18-2015 08:15 AM
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?
Solved! Go to Solution.
03-18-2015 12:48 PM
03-19-2015 07:57 AM
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.
03-19-2015 08:35 AM
@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.
03-19-2015 08:43 AM
@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.
03-19-2015 09:18 AM
@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.