How to integrate web.config and app.config

  • Thread starter Thread starter ad
  • Start date Start date
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?
 
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.
 
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
 
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
 
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?
 
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
---
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
 
Back
Top