I'm trying to extend my web.config file with custom server configuration that is necessary for IIS. But I'm not sure how to do this as there is already a web.config file auto-generated at publish time. So I need to merge my custom config into this file.
I already tried to transform the web.config file but it just could not get it working. Even if it did I would have to create for example a web.Debug.config and web.Release.config with the same content.
After a lot of trial and error we found out that the solution is really easy (but for some reason we have not found a single helpful internet source that told us this thing):
The
web.configfiles just get merged at publish time!So I just:
web.configfileBuild Action: ContentandCopy to Output Directory: Copy if newerto be able to use the custom config at debug timeAnd now on publish I get a single
web.configwith both the auto generated and custom settings.