Frustrations with Web Deployment Projects
Web deployment projects are an elegant way of integrating the compilation of an asp.net web site into a build process. I was initially really impressed with the msbuild task that replaces sections of your web.config at build time. Unfortunately this feature is starting to dissapoint. As this forum post points out it is fairly limited in scope as to what sections it can modify. I recently tried getting the deployment project to update the system.net/mailSettings section. I have yet to get it to modify this section. The build will just fail saying that it cant find system.net/mailSettings. This shouldnt be this hard. I hope I'm totally missing something and the rest of this post can just be ignored.
Ok, Im the moron on this one. under is a group not a config section as I orginally thought. Once I changed the deployment project to this:
It worked like a champ.
So the moral of this story is check, double check and triple check what type of node you are trying to replace in the deplyment project.
I'm still not sure why it matters what type of node you are replacing.
Update: Some good ideas here for more advanced scenarios.