questions

S

Sreenivas

I have a couple of questions
Can i store web.config as aaa.config as still run it as a web.config?
What should i do to run aaa.config as a web.config
Can i store global.asax as aaa.asax as still run it as a global.asax ?
What should i do to run aaa.asax as a global.asax ?
How many elements i can store in the key value pairs in <appsettings>
element?
I think the answer for last one is infinite,since it is a dictionary
you
could store infinite elements.
What you people say?
 
G

Guest

I have a couple of questions
Can i store web.config as aaa.config as still run it as a web.config?
What should i do to run aaa.config as a web.config
Can i store global.asax as aaa.asax as still run it as a global.asax ?
What should i do to run aaa.asax as a global.asax ?
How many elements i can store in the  key value pairs in <appsettings>
element?
I think the answer for last one is infinite,since it is a dictionary
you
could store infinite elements.
What you people say?

1-2: No, you can't rename these files. If you bother about security,
web.config and global.asax files are protected by IIS by default, and
clients cannot get to them.
3. Web.config is stored into memory therefor this could be a machine
specific limit.
 
N

Nick Gilbert

Sreenivas said:
I have a couple of questions
Can i store web.config as aaa.config as still run it as a web.config?
What should i do to run aaa.config as a web.config
Can i store global.asax as aaa.asax as still run it as a global.asax ?
What should i do to run aaa.asax as a global.asax ?
How many elements i can store in the key value pairs in <appsettings>
element?
I think the answer for last one is infinite,since it is a dictionary
you
could store infinite elements.
What you people say?

It's an odd question to ask. Why do you need to do that? Perhaps if you
tell us the problem we can suggest a better solution than renaming
web.config. There is no logical reason to do this as calling it
web.config works fine.

Nick
 
S

Sreenivas

It's an odd question to ask. Why do you need to do that? Perhaps if you
tell us the problem we can suggest a better solution than renaming
web.config. There is no logical reason to do this as calling it
web.config works fine.

Nick

One guy asked me these questions in the interview and i said i don't
know..
I thought it worths to know the answers in the usenet.
Alexey and Nick..
Can you people answer my third question..
<appsettings>
<add key="" value=""/>
</appsettings>
How many of the above "add" elements i can store in the web.config?
 
G

Guest

One guy asked me  these questions in the interview and i said i don't
know..
I thought it worths to know the answers in the usenet.
Alexey and Nick..
Can you people answer  my third question..
<appsettings>
     <add key="" value=""/>
</appsettings>
How many of the above "add" elements i  can store in the web.config?- Hide quoted text -

- Show quoted text -

As far as I know where is no fixed limit for this. But because the
web.config file is loaded into memory you should avoid adding more
settings than is necessary. Web.config defines basic configuration,
required e.g. to move an application between development and
production environments and it would be wrong to put into it all
things which could be stored in the database.
 
N

Nick Gilbert

Can you people answer my third question..
<appsettings>
<add key="" value=""/>
</appsettings>
How many of the above "add" elements i can store in the web.config?

No limit, but if you're thinking of putting more than about 20 things in
here, then you're probably using it for the wrong purpose! This is only
for storing configuration information. Don't try and store actual data
in the web.config file - you should use a proper database for that.

None of my sites have more than 10-12 things in them. Mainly it's for
configuring things which are different on each server - like email
addresses for sending notifications to, or paths to folders on the hard
disk for that particular version of the site.

Every time you change web.config, the application has to be restarted
and any users on the site will be logged out unless you're using the
session state server. So don't put anything here which changes often.
You shouldn't need to edit web.config unless you've made some major
changes to the site. Anything else belongs in a database.

Nick.
 
D

dw

No limit, but if you're thinking of putting more than about 20 things in
here, then you're probably using it for the wrong purpose! This is only
for storing configuration information. Don't try and store actual data
in the web.config file - you should use a proper database for that.

None of my sites have more than 10-12 things in them. Mainly it's for
configuring things which are different on each server - like email
addresses for sending notifications to, or paths to folders on the hard
disk for that particular version of the site.

Every time you change web.config, the application has to be restarted
and any users on the site will be logged out unless you're using the
session state server. So don't put anything here which changes often.
You shouldn't need to edit web.config unless you've made some major
changes to the site. Anything else belongs in a database.

Nick.

If you have a large number of AppSettings items, you could create a
second file (name it myAppSettings or whatever), listing all your
appsettings there, and in your web.config file, just refer to that
other file
<appSettings configSource="myAppSettings.config"/>

This way, also, if you make an addition to the myappsetings file, it
won't restart the entire application.

David Wier
http://aspnet101.com
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top