two config files

  • Thread starter Thread starter Vaclav
  • Start date Start date
V

Vaclav

Hi

Is it possible to have two config files (not just web.config) in one folder?
I need the other one for connection string to the DB

Thank you
Vaclav
 
You can have as many as you want, but you have to process them yourself.
The server only processes the web.config.
 
Hi,

Having two config files can be better than having one. If u keep everything
in web.config and try to change any bit from it, application will be
restarted. This may not be good on production server. So u can separate out
those bits which are bound to change in separate config file.

Thanks you
 
Thank you very much.
I read somewhere that it is possible to include a small config file in the
normal web.config and then there is no need to process them separately. But
I cannot find the syntax how to do it.

Vaclav
 
That is different from your original question. Take a look a
IConfigurationSectionHandler. Using this you can create arbitrarily complex
configuration sections in the standard web.config.
 
By the way, I have been playing around with ASP.NET 2 and there is a section
specifically designed to hold connection strings.
 
Thank you,
Maybe I did not explain it clear. I need to put the connection string to a
separate file (not just section) because when I FTP my app to the production
server, I do not want to pass my development DB conn string there. So I want
to upload all settings but the conn string. I heard there is some sort of
external include for the web.config.

Vaclav
 
Vaclav said:
Thank you,
Maybe I did not explain it clear. I need to put the connection string to a
separate file (not just section) because when I FTP my app to the
production server, I do not want to pass my development DB conn string
there. So I want to upload all settings but the conn string. I heard there
is some sort of external include for the web.config.

Vaclav
You are looking for this thype of syntax :

....

<browserCaps>
<file src="Web.browserCaps.xml" />
</browserCaps>
</system.web>

<appSettings file="Commun.config">
</appSettings>

....
 

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

Back
Top