Sunday 31 December 2017

c# - Does a web.config substitute app.config?

itemprop="text">

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




Answer






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.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...