ASP.Net app, Class Library and Web Service

J

Joe Reazor

I have an ASP.Net application that uses some Class Libraries (dll's) that I
created separately. One of these dll's connects to a Web Service. I
created the Web Reference to my web service and doing so creates my
App.Config file. I thought I would then be able to use the config file to
specify where the Web Service existed to connect to. The problem is that I
found out that Class Libraries (dll's) don't have their own config files,
they must use the config files of their containing app. In this case its a
web app. So I try adding the appropriate settings in the Web.Config file
hoping that it would be picked up by my dll, but no luck. Is there
something I am missing? Is this possible in the standard method that
everyone says to use, is there some other way, or am I screwed and I will be
stuck recompiling my dll every time I want to change the host of the web
service.

TIA for any help.


==============
Joe Reazor
Gorbel Inc.
email: joereaATgorbelDOTcom
 
D

Dino Chiesa [MSFT]

settings within web.config should be retrievable from your DLL ;
I do this and it works for me.

do you use System.Configuration.ConfigurationSettings.AppSettings??

What is the problem you are seeing?
 
J

Joe Reazor

I'll give that a try. In the examples I had seen it looked like an
application that was using a Web Service would automatically read the web
service's location from the config file. I didn't think there was anything
else I needed to do other than to add the web reference and keep the config
file with my app. So with a web app I need to do the extra step to read
from the configuration settings and set the URL of the web service object.
Maybe I would need to do this with a regular executable, but I didn't think
so. That's why I was getting confused.


==============
Joe Reazor
Gorbel Inc.
email: joereaATgorbelDOTcom
 

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