Does a web.config substitute app.config?

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.

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?

The funny thing is that everything works OK even without copying this section to the web.config. How come?

TIA


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.

The web project only looks at Web.config, so you will need to copy the configuration to your web.config.

链接地址: http://www.djcxy.com/p/21094.html

上一篇: .NET中的文件

下一篇: 做一个web.config替代app.config?