web.config, configSource, and "The 'xxx' element is not declared" warning.
- by UpTheCreek
I have broken down the horribly unwieldy web.config file into individual files for some of the sections (e.g. connectionStrings, authentication, pages etc.) using the configSource attribute.
This is working file, but the individual xml files that hold the section 'snippets' cause warnings in VS.
For example, a file named roleManager.config is used for the role manager section, and looks like this:
<roleManager enabled="false">
</rolemanager>
However I get a blue squiggle under the roleManager element in VS, and the following warning: The 'roleManager' element is not declared
I guess this is something to do with valid xml and schemas etc. Is there an easy way to fix this? Something I can add to the individual files?
Thanks
P.S. I have heard that it is bad practice to break the web.config file out like this. But don't really understand why - can anyone illuminate me?