[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

ASP.Net app, Class Library and Web Service

Joe Reazor

7/23/2003 6:46:00 PM

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


2 Answers

Dino Chiesa [MSFT]

7/23/2003 7:49:00 PM

0

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?


"Joe Reazor" <joenospam@belgor.com> wrote in message
news:eFnDnqUUDHA.2116@TK2MSFTNGP12.phx.gbl...
> 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
>
>


Joe Reazor

7/24/2003 12:26:00 PM

0

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

"Dino Chiesa [MSFT]" <dinoch@microsoft.com> wrote in message
news:#$Ne1NVUDHA.2196@TK2MSFTNGP12.phx.gbl...
> 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?
>
>
> "Joe Reazor" <joenospam@belgor.com> wrote in message
> news:eFnDnqUUDHA.2116@TK2MSFTNGP12.phx.gbl...
> > 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
> >
> >
>
>