Hey guys -
We have an application that loads a specific DLL depending upon which "study" the user wants to access. This works just fine if all study-specific DLLs are located in the same folder as the main app's EXE.
How can we implement late binding to happen on a DLL in a sub-folder of the main folder?
root\MainApp.exe
root\Study1\Study.dll
root\Study1\OtherDLLsETC.dll
Putting all of the study-specific DLLs into the root folder will get nasty and may mean that we need to put the version numbers into the dll filenames, which is not good for us.
The late binding code we use is as follows:
Dim assem As System.Reflection.Assembly
Dim ty As Type
assem = System.Reflection.Assembly.Load(sStudyClassPrefix)
' sStudyClass must exist in the same folder as the EXE
ty = assem.GetType(sStudyClass)
oStudy = Activator.CreateInstance(ty)
We have an application that loads a specific DLL depending upon which "study" the user wants to access. This works just fine if all study-specific DLLs are located in the same folder as the main app's EXE.
How can we implement late binding to happen on a DLL in a sub-folder of the main folder?
root\MainApp.exe
root\Study1\Study.dll
root\Study1\OtherDLLsETC.dll
Putting all of the study-specific DLLs into the root folder will get nasty and may mean that we need to put the version numbers into the dll filenames, which is not good for us.
The late binding code we use is as follows:
Dim assem As System.Reflection.Assembly
Dim ty As Type
assem = System.Reflection.Assembly.Load(sStudyClassPrefix)
' sStudyClass must exist in the same folder as the EXE
ty = assem.GetType(sStudyClass)
oStudy = Activator.CreateInstance(ty)