机器配置 [英] Machine Config

查看:118
本文介绍了机器配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All


我需要询问.NET中的配置文件,

有两个配置文件

1.网络配置

2.机器配置

我了解Web配置的用法,但无法理解

机器的使用情况配置。

我在文章中读到你也可以写你的数据库连接

机器配置中的字符串

如果这是真的那么为什么人们使用web配置,我们可以在机器上写下

整个配置

设置。


可以解释一下为什么.net框架工作需要两个配置文件

如果我们在两个文件中写相同的内容(配置设置)????

关于

Tarun Sinha

解决方案

> Hello All


我需要询问一下.NET中的配置文件,
有两个配置文件
1. Web配置
2.机器配置
我了解Web配置的用法,但无法理解机器配置的用法。
我在文章中读到你也可以编写你的数据库连接
机器配置中的字符串
如果这是真的那么为什么人们使用web配置,我们可以在机器上写下
整个配置
设置。

可以解释一下我为什么.net框架工作需要两个配置文件
如果我们在两个文件中写相同的内容(配置设置)????

关于
Tarun Sinha



machine.config是一个单独的文件,用于保存整个

机器的配置,

web.config是web-具体应用。您可能有多个副本。


示例:我们的服务器上有多个站点,需要单独的

连接字符串!

Hans Kesting


您可以使用任意数量的XXX.Config。 Machine.Config为整个Web服务器提供了

配置设置。每个Web.Config

为其OWN目录提供配置设置,并在其下面提供所有子

目录。子目录中的配置文件除了从

父目录继承的配置信息外,还可以提供配置信息,并且子目录配置设置可以

OVERRIDE或者修改父目录中定义的设置。


-Rick


感谢''s's's's repl me ,但是,

如果我们有一个多站点,那么我们还有一个多网络配置..

那么我们为什么要求

机器配置,我们可以从

web config获取有关配置设置的信息,而不是机器配置


关于

tarun sinha


Hello All

I need to ask about the configuration file in .NET,
There are Two config File
1. Web Config
2. Machine config
I understand the the usage of Web config , but not able to understand
the usage of Machine config.
I read in the article that you can also write your database connection
string in Machine Config
if this is true then why the people using web config , we can write the
whole configurartion
setting in machine.

Can any explain me why .net frame work requires two configuration file
if we write the same content (config setting) in both the files ????
With regards
Tarun Sinha

解决方案

> Hello All


I need to ask about the configuration file in .NET,
There are Two config File
1. Web Config
2. Machine config
I understand the the usage of Web config , but not able to understand
the usage of Machine config.
I read in the article that you can also write your database connection
string in Machine Config
if this is true then why the people using web config , we can write the
whole configurartion
setting in machine.

Can any explain me why .net frame work requires two configuration file
if we write the same content (config setting) in both the files ????

With regards
Tarun Sinha



machine.config is a single file that holds configuration for the entire
machine,
web.config is web-application specific. You might have multiple copies.

Example: we have multiple sites on our server, that need separate
connection strings!
Hans Kesting


You can use any number of XXX.Config. The Machine.Config provides
configuration settings for the ENTIRE web server. Each Web.Config
provides configuration settings to its OWN directory, and all sub
directories below it. Configuration files in child directories can
supply configuration information in addition to that inherited from
parent directories, and the child directory configuration settings can
OVERRIDE or modify settings defined in parent directories.

-Rick


Thank''s for repl me so soon, but,
if we have an multiple site then we have also an mutiple web config ..
then why we require for
machine config, we can get the info about configuration setting from
web config instead of machine config

with regards
tarun sinha


这篇关于机器配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆