By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,478 Members | 1,833 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,478 IT Pros & Developers. It's quick & easy.

How to integrate web.config and app.config

P: n/a
ad
I am developing web applicaiton with VS2005.
The WebApp used a ClassLibrary in another project.
There are some TableAdapter in the classlibrary, and the TableAdapter use
the connection in the app.config.
The WebApp have also it's own connection string in the web.config.
After developing, I must deployment my web application into the server.
How can I integrate both config after when deployment?
May 19 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
A class library doesn't have a config file. It uses the application
configuration file of whatever application it is used by. Just put the
necessary configuration data in the web.config file.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:Ou****************@TK2MSFTNGP02.phx.gbl...
I am developing web applicaiton with VS2005.
The WebApp used a ClassLibrary in another project.
There are some TableAdapter in the classlibrary, and the TableAdapter use
the connection in the app.config.
The WebApp have also it's own connection string in the web.config.
After developing, I must deployment my web application into the server.
How can I integrate both config after when deployment?

May 19 '06 #2

P: n/a
ad
But when I add a TableAdapter into the classlibrary by TableAdpater Wizard,
it will ask me to put the conneciton string into the app.config

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> glsD:eX**************@TK2MSFTNGP03.phx.g bl...
A class library doesn't have a config file. It uses the application
configuration file of whatever application it is used by. Just put the
necessary configuration data in the web.config file.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:Ou****************@TK2MSFTNGP02.phx.gbl...
I am developing web applicaiton with VS2005.
The WebApp used a ClassLibrary in another project.
There are some TableAdapter in the classlibrary, and the TableAdapter use
the connection in the app.config.
The WebApp have also it's own connection string in the web.config.
After developing, I must deployment my web application into the server.
How can I integrate both config after when deployment?


May 20 '06 #3

P: n/a
Hello ad,

Add <appSettings file="config/app.config" /> string to the Web.Config where
local.config is you app.config
and you website can use you application config

a> I am developing web applicaiton with VS2005.
a> The WebApp used a ClassLibrary in another project.
a> There are some TableAdapter in the classlibrary, and the TableAdapter
a> use
a> the connection in the app.config.
a> The WebApp have also it's own connection string in the web.config.
a> After developing, I must deployment my web application into the
a> server. How can I integrate both config after when deployment?
a>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 20 '06 #4

P: n/a
ad
Thank very munch.
I have still some question.
1. After deployment, the app.config is disappear. How can I modified the
value of app.config.
2. If I have two ClassLibrary to refer. How can I add the different
app.setting in the web.config?

"Michael Nemtsev" <ne*****@msn.com>
???????:9c**************************@msnews.micros oft.com...
Hello ad,

Add <appSettings file="config/app.config" /> string to the Web.Config
where local.config is you app.config
and you website can use you application config
a> I am developing web applicaiton with VS2005.
a> The WebApp used a ClassLibrary in another project.
a> There are some TableAdapter in the classlibrary, and the TableAdapter
a> use
a> the connection in the app.config.
a> The WebApp have also it's own connection string in the web.config.
a> After developing, I must deployment my web application into the
a> server. How can I integrate both config after when deployment?
a> ---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche

May 21 '06 #5

P: n/a
Hello ad,

a> Thank very munch.
a> I have still some question.
a> 1. After deployment, the app.config is disappear. How can I modified
a> the
a> value of app.config.

Deleted or renamed?

a> 2. If I have two ClassLibrary to refer. How can I add the different
a> app.setting in the web.config?

No way, create separate configs for each library and use System.Xml namespace
to read data
Add <appSettings file="config/app.config" /> string to the
Web.Config
where local.config is you app.config
and you website can use you application config
a> I am developing web applicaiton with VS2005.
a> The WebApp used a ClassLibrary in another project.
a> There are some TableAdapter in the classlibrary, and the
TableAdapter
a> use
a> the connection in the app.config.
a> The WebApp have also it's own connection string in the web.config.
a> After developing, I must deployment my web application into the
a> server. How can I integrate both config after when deployment?
a> ---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 21 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.