Does a web.config substitute app.config?

旧巷老猫 提交于 2019-12-12 01:26:29

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/7628985/does-a-web-config-substitute-app-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!