I think you have the honors of finding the first bug. We're using
Configuration.Sections[] to acess the replaceable sections and it doesn't appear to work with system.web.
I'll enter the bug. Thanks!
If you're
desperate you can always create a custom task to do. If you want to peruse that let me know.
btw: we found the problem. system.web is actually a section group. A subtle difference but only sections support the configSource attribute.
Unfortunately the Beta of Web Deployment Projects does not let you replace a section within a section group.For example system.web/authentication where system.web is the section group and authentication is the section.
We’ve fixed this issue so that in the update you’ll be able to replace sections within section groups.For example:
Brad, do you know when the update will be released? I am having the same problem. I also need to replace the applicationSettings section group and that does not work either.
I think you have the honors of finding the first bug. We're using
Configuration.Sections[] to acess the replaceable sections and it doesn't appear to work with system.web.
I'll enter the bug. Thanks!
If you're
desperate you can always create a custom task to do. If you want to peruse that let me know.
Brad.
Could you please explain how I could create a custom task to do this?
This technique only works for config sections, if you instead want to repalce the entire system.web section group you should consider just replacing the entire file with a Copy command. Another option would be
to try an merge files using the
XmlDocument Class. That's more involved but would be pretty cool.
We are also experiencing the same problem. In our case, we have the issue when trying to replace Web references (references to web services). They are dynamic and VS 2005 adds a custom configuration section to app.config (that can be copied into web.config).
The section is inside a section group and can not be replaced in the current version of the Web Deployment Project. Hope you can release an updated version soon, as many projects include web references.
HarryPfleger
Member
36 Points
12 Posts
Web Deployment Projects: Web.config sections <system.web>
Nov 10, 2005 09:29 AM|LINK
I encounter the following by trying to replace the system.web config section in Web.config.
During the build I get
Web.config (1): error WDP00002: missing section system.web.
I can replace other parts of the Web.config, like appSettings, connectionStrings and even system.runtime.remoting, but not system.web.
Any ideas? Thankx!
BradleyB
Participant
1197 Points
230 Posts
Microsoft
Re: Web Deployment Projects: Web.config sections <system.web>
Nov 11, 2005 01:02 AM|LINK
I'll enter the bug. Thanks!
If you're desperate you can always create a custom task to do. If you want to peruse that let me know.
Brad.
Robert W. An...
Member
5 Points
1 Post
Re: Web Deployment Projects: Web.config sections <system.web>
Nov 11, 2005 03:53 AM|LINK
Will this solve your problem?
SimonCal
Participant
1910 Points
384 Posts
Microsoft
Re: Web Deployment Projects: Web.config sections <system.web>
Nov 11, 2005 04:39 PM|LINK
Thanks for the feedback. Is there a compelling reason that you are replacing the entire system.web config section in one shot?
This posting is provided "AS IS" with no warranties, and confers no rights.
BradleyB
Participant
1197 Points
230 Posts
Microsoft
Re: Web Deployment Projects: Web.config sections <system.web>
Nov 17, 2005 12:09 AM|LINK
btw: we found the problem. system.web is actually a section group. A subtle difference but only sections support the configSource attribute. Unfortunately the Beta of Web Deployment Projects does not let you replace a section within a section group. For example system.web/authentication where system.web is the section group and authentication is the section.
We’ve fixed this issue so that in the update you’ll be able to replace sections within section groups. For example:
system.web/authentication = authentication.config
system.net/mailSettings = mailSettings.config
Hope this will help. Brad.
deuxex25
Member
65 Points
13 Posts
Re: Web Deployment Projects: Web.config sections <system.web>
Nov 17, 2005 05:18 PM|LINK
SimonCal
Participant
1910 Points
384 Posts
Microsoft
Re: Web Deployment Projects: Web.config sections <system.web>
Nov 17, 2005 05:53 PM|LINK
We are starting to figure out a possible schedule, but nothing firm yet.
This posting is provided "AS IS" with no warranties, and confers no rights.
deuxex25
Member
65 Points
13 Posts
Re: Web Deployment Projects: Web.config sections <system.web>
Dec 01, 2005 02:38 PM|LINK
Could you please explain how I could create a custom task to do this?
BradleyB
Participant
1197 Points
230 Posts
Microsoft
Re: Web Deployment Projects: Web.config sections <system.web>
Dec 02, 2005 07:44 PM|LINK
I just created a post on how to create a custom msbuild task for auto-incrementing version numbers. How to auto-increment assembly version using a custom MSBuild task
This will give you a basic idea of how to create and use a custom msbuild task.
One of things you'll need to do in your task is get a Configuration object for the web.config file.
Here is a snippit that will do that.
/// <summary>
/// Gets the Configuration object for web.config
/// </summary>
private Configuration GetWebConfiguration()
{
WebConfigurationFileMap webMap = new WebConfigurationFileMap();
VirtualDirectoryMapping vDirMap = new VirtualDirectoryMapping(_webRoot, true);
webMap.VirtualDirectories.Add("/", vDirMap);
return WebConfigurationManager.OpenMappedWebConfiguration(webMap, "/");
}
Once you have a Configruation object you can do things like this:
// Find the section in the configuration
ConfigurationSection configSection = config.GetSection(“system.web/authentication”);
configSection.SectionInformation.ConfigSource = filename;
Where filename contians the new section.
This technique only works for config sections, if you instead want to repalce the entire system.web section group you should consider just replacing the entire file with a Copy command. Another option would be to try an merge files using the XmlDocument Class. That's more involved but would be pretty cool.
I hope this gives you enough to get started.
Brad.
proturbo
Member
46 Points
11 Posts
Re: Web Deployment Projects: Web.config sections <system.web>
Jan 19, 2006 01:08 PM|LINK
Hi!
We are also experiencing the same problem. In our case, we have the issue when trying to replace Web references (references to web services). They are dynamic and VS 2005 adds a custom configuration section to app.config (that can be copied into web.config). The section is inside a section group and can not be replaced in the current version of the Web Deployment Project. Hope you can release an updated version soon, as many projects include web references.
Thanks!