Dynamic Web Reference in Class Lib/GAC

M

Mike Logan

Hello. I have a shared assembly with a reference to one of our web services.
This web reference needs to be dynamic so that we can use different URLs
between our different environments (dev, test, production). I see that an
app.config file has been created in the assembly where I can put the
different URLs, but where does this app.config reside if the shared assembly
is inserted into the GAC?
 
D

Dilip Krishnan

Hello Mike,
The shared app has to be used by an executeable/client application. The
configuration for the shared assembly should be merged with the configuration
of the executeable.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
 
M

Mike Logan

Dilip,

We would like to avoid placing configuration information for the shared
assembly in each web application. Can the shared assembly put configuration
information into the Machine.Config?

Thanks, Mike
 
D

Dilip Krishnan

Hello Mike,
No the configuration will not get picked up by the application if you
put it in the machine.config. It will only look for the <exename>/web.config.
Not only that you dont want to mess up the machine.config as far as possible.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
 
M

[MSFT]

I agree with Dilip, machine.config is not a good place for such
information. Here is some options in my thoughts:

1.Create a standalone XML or Text file, and save in a particular place so
that your app can find it.
2. Save such information in System registry
3. Create a Assembly to manage such Url, and call it in your assembly.

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top