473,383 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Accessing dlls at runtime

Hi

I have a set of classes (application framework) in the form of a dll that I
have set to install in [Common Files]\[My Folder] folder by default on the
target user's pcs. This path can also be changed by the user when running
the setup on their pcs.

The problem is how do I tell me main apps (which get installed separately)
to find out the location of the dll and use its reference on the target pcs?

Thanks

Regards
Nov 21 '05 #1
8 1260
To me this appears to be one of those "if it hurts, don't do it" things.
Users typically get to choose only the primary application folder (TARGETDIR
in a VS setup) and supporting infrastructure goes where it needs to be to
have everything work. I assume you've already given the user a choice for
the primary application folder, so does that mean you have another dialog
for the location of this Dll? Or is this a separate setup? I really think
this is one of those times where you should just put it where it should be,
and that's common with supporting infrastructure files. Delete the dialog
that offers the choice!
--
Phil Wilson
[Microsoft MVP-Windows Installer]
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:eA**************@TK2MSFTNGP09.phx.gbl...
Hi

I have a set of classes (application framework) in the form of a dll that
I have set to install in [Common Files]\[My Folder] folder by default on
the target user's pcs. This path can also be changed by the user when
running the setup on their pcs.

The problem is how do I tell me main apps (which get installed separately)
to find out the location of the dll and use its reference on the target
pcs?

Thanks

Regards

Nov 21 '05 #2
Hi Phil

The app framework and actual apps are separate setups. The reason I did that
was to keep the apps "clean" and not having to include the framework source
in each project. Also people who do not have access to framework source code
(sometimes preferable) will also be able to develop around the framework, if
this works.

I guess one way is to store the framework dll path in a registry key on
install. What I don't know is how to reference this in my app at design and
runtime.

Thanks

Regards
"Phil Wilson" <pd*******@nospam.cox.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
To me this appears to be one of those "if it hurts, don't do it" things.
Users typically get to choose only the primary application folder
(TARGETDIR in a VS setup) and supporting infrastructure goes where it
needs to be to have everything work. I assume you've already given the
user a choice for the primary application folder, so does that mean you
have another dialog for the location of this Dll? Or is this a separate
setup? I really think this is one of those times where you should just put
it where it should be, and that's common with supporting infrastructure
files. Delete the dialog that offers the choice!
--
Phil Wilson
[Microsoft MVP-Windows Installer]
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:eA**************@TK2MSFTNGP09.phx.gbl...
Hi

I have a set of classes (application framework) in the form of a dll that
I have set to install in [Common Files]\[My Folder] folder by default on
the target user's pcs. This path can also be changed by the user when
running the setup on their pcs.

The problem is how do I tell me main apps (which get installed
separately) to find out the location of the dll and use its reference on
the target pcs?

Thanks

Regards


Nov 21 '05 #3
why not install it to the GAC? the Runtime looks there first when it
attempts to bind.

Nov 21 '05 #4
Hmmm...this sounds interesting. Where can I get more info on how to do
this??

Thanks

Regards

"stand__sure" <st*********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
why not install it to the GAC? the Runtime looks there first when it
attempts to bind.

Nov 21 '05 #5
OK, installed it in gac. Now how do I access it in my other apps?

Thanks

Regards

"stand__sure" <st*********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
why not install it to the GAC? the Runtime looks there first when it
attempts to bind.

Nov 21 '05 #6
Well if "access" means "link to when the programs run", it will just work
because the GAC is the the first place default location where the runtime
will look for a dependent assembly. Of course the assembly must match the
client requirements for assemblyversion, strong name etc.

There are some gotchas with updating files installed by MSI into the GAC, so
I'd ensure you figure out how to replace it with a new version before
committing to using the GAC. The fixed common location will be easier to
update than the GAC.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
OK, installed it in gac. Now how do I access it in my other apps?

Thanks

Regards

"stand__sure" <st*********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
why not install it to the GAC? the Runtime looks there first when it
attempts to bind.


Nov 21 '05 #7
So if the dll is installed in the [Prorgam files]\[Common Files]\[My Class]
folder then how can I access the dll regardless of which drive the [Prorgam
files]\[Common Files]\[My Class] folder is on?

Thanks

Regards
"Phil Wilson" <pd*******@nospam.cox.net> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
Well if "access" means "link to when the programs run", it will just work
because the GAC is the the first place default location where the runtime
will look for a dependent assembly. Of course the assembly must match the
client requirements for assemblyversion, strong name etc.

There are some gotchas with updating files installed by MSI into the GAC,
so I'd ensure you figure out how to replace it with a new version before
committing to using the GAC. The fixed common location will be easier to
update than the GAC.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
OK, installed it in gac. Now how do I access it in my other apps?

Thanks

Regards

"stand__sure" <st*********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
why not install it to the GAC? the Runtime looks there first when it
attempts to bind.



Nov 21 '05 #8
Well your main problem is that the best place for dependent assemblies to be
installed is right next to the app that uses it. You've got an unusual
deployment model where an assembly which is required for one or more apps is
likely to be installed in some completely random folder, and that's not the
usual deployment model that people use, and that's why someone suggested the
GAC. If client programs want to cleanly instantiate objects from your
assembly with the deployment model you're using, you don't have any
reasonable choice except the GAC. Dependent assemblies pretty much need to
be in the same directory as the client app, or in a subfolder via
redirection, or in the GAC.

If you want some other fixed location, you can tell your clients that they
need to do some kind of assembly load from somewhere in
Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData)
and instantiate objects that way, but that isn't the usual way.
--
Phil Wilson [MVP Windows Installer]
----
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
So if the dll is installed in the [Prorgam files]\[Common Files]\[My
Class] folder then how can I access the dll regardless of which drive the
[Prorgam files]\[Common Files]\[My Class] folder is on?

Thanks

Regards
"Phil Wilson" <pd*******@nospam.cox.net> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
Well if "access" means "link to when the programs run", it will just work
because the GAC is the the first place default location where the runtime
will look for a dependent assembly. Of course the assembly must match the
client requirements for assemblyversion, strong name etc.

There are some gotchas with updating files installed by MSI into the GAC,
so I'd ensure you figure out how to replace it with a new version before
committing to using the GAC. The fixed common location will be easier to
update than the GAC.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
OK, installed it in gac. Now how do I access it in my other apps?

Thanks

Regards

"stand__sure" <st*********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
why not install it to the GAC? the Runtime looks there first when it
attempts to bind.



Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: BobM | last post by:
I am running a client based application written in C#. As part of the deveopment I am utilizing a set of dlls which is part of a vendors application (not written in .Net). So I have written a...
1
by: Ramanujam R | last post by:
I'm trying to move a portion of our application to .NET from VC6 - the idea was to let most of the older DLLs still be compiled with VC6. As a first step just opened the project with VC7, and...
8
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock...
3
by: Clift Norris | last post by:
I've created a managed C++ assembly containing a managed class that is instantiated from ASP.NET. The managed C++ assembly needs msvcp71.dll and msvcr71.dll. When ASP.NET loads the assembly, it...
7
by: Oenone | last post by:
I'm sure there's an obvious way to do this, but I'm missing it so far. I have an ASP.NET application that relies on several DLLs to work. Currently in order to get my site working I have to put...
3
by: John | last post by:
Hi What are the advantages of storing ones class project dlls in gac? How can one access these dlls? Thanks Regards
9
by: yevvi | last post by:
Hi, We have a product with bunch of dlls which are now built with Visual Studio 2003. We want to switch the build to use VS2005. I have read that in VS2005 runtime libraries come as...
5
by: jaume.pf | last post by:
Hi, I've a vb dll with a function that i want to access from C#. I'm using the following: public class library { public static extern void create(); }
6
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
Using Visual Studio 2005, I have created 4 small DLLs that our company projects can use to access common tools included in each of the separate DLL files. Our Visual Studio 2005 applications...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.