Difference between web. config and App. config

Source: Internet
Author: User

Web. config is used with Web {
Adlinkmouseclick (event, this, 0 );
} "Onmouseout =" function onmouseout ()
{
Adlinkmouseout (event, this, 0 );
} "Onmouseover =" function onmouseover ()
{
Adlinkmouseover (event, this, 0 );
} "Class =" Klink "oncontextmenu =" function oncontextmenu ()
{
Return false;
} "Id =" konalink0 "style =" position: static; text-Decoration: underline! Important "> applications. Web. config will by default have several deployments required for the web application. You can have a web. config for each folder under your web application.

App. config is used for Windows applications. when you build the application in vs.net, it will be automatically renamed to <appname>. EXE. config and this file has to be delivered along with your application.

You can use the same method to call the specified ettings values from both config files:

System. configuration. configurationsettings. deleettings ["key"]

------

 

If you make any changes to the Web. config, web application will immediately load the changed config. But in case of <Application name>. EXE. config, You have to restart the application.

 

------

What about console applications? They don't seem to have an app. config file when I create such a project in Visual Studio. however, I'm working with the logging Application Block Sample Apps, And the console ones have an app. config file. I don't know if that config file was manually created by whoever made the sample, or if it is supposed to be automatically added to the project somehow.

Simon.

-----

 

App. config is not automatically added. You can go to the Solution Explorer, select 'add new item' and add the 'Application configuration file '.
-----

 

I am not very sure about whether any other difference is there in both. From the notes I read I found that

An app. config file is called "app. config" because it is the configuration
File for an application, it cannot be used for a class library.
Web. config is an ASP. NET app. config file
Both
Enable application to have its own configuration.

Suppose for example you have a C # class library with app. config in your Asp.net project with web. config then the project will refer only web. config as the project is an Asp.net project though the project has des C # And app. config.

If you found some other details in this topic do forward me

To veenswats2006@yahoo.co.in

-----

 

More @: http://www.dotnetspider.com/forum/ViewForum.aspx? Forumid = 21

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.