web.config可以替代app.config吗? [英] Does a web.config substitute app.config?
问题描述
我用C#编写了一个dll项目.我添加了服务参考. app.config是自动生成的. 在相同的解决方案中,我有一个asp.net项目.
I wrote a dll project in c#. I added a service reference. A app.config was automatically generated. In the same solution I have an asp.net project.
如果我将相关配置从app.config复制粘贴到web.config并更改客户端url,它将覆盖app.config中的服务url吗?
If I copy paste the relevant configuration from the app.config to the web.config and change the client url - will it override the service url in the app.config?
有趣的是,即使没有将此部分复制到web.config,一切都可以正常进行.怎么会来?
The funny thing is that everything works OK even without copying this section to the web.config. How come?
TIA
推荐答案
是.
web和app.config的配置架构相同.有些部分仅对Web应用程序有意义,而通常情况并非如此.您应该可以很好地复制粘贴您的配置.
Yes.
The config schema is the same for web and app.config. There are some sections that will only make sense for web apps, but generally not the other way around. You should be just fine copy-pasting your configuration.
该Web项目仅查看Web.config,因此您将 将配置复制到您的web.config.
The web project only looks at Web.config, so you will need to copy the configuration to your web.config.
这篇关于web.config可以替代app.config吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!