Hi!!
When I try to build a Web deployment project, if I want to replace the <compilation> section inside <system.web> I keep on getting this error: web.config(1): error WDP00002: missing section compilation.
I've tried to use the whole system.web branch or just the compilation branch into the replacement file, with no luck.
Any idea on this??
Is there a source of documentation about web.config replacement best procedures? I couldn't find anything on the Internet.
Thanks!!
Juan
Juan Barrera
MCTS
Please remember to click "Mark as Answer" on this post if it helped you.
Hi!!
When I try to build a Web deployment project, if I want to replace the <compilation> section inside <system.web> I keep on getting this error: web.config(1): error WDP00002: missing section compilation.
[..]
Any idea on this??
What about <system.net> section?
I store smtp parameters there but when I set system.net/mailSettings=myParam.config I recevied the following error:
C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets(613,9): error : web.config(1): error WDP00002: missing section system.net/mailSettings.
I store smtp parameters there but when I set system.net/mailSettings=myParam.config I recevied the following error:
[....]
<system.net>
<mailSettings>
[....]
</mailSettings>
</system.net>
If you want to replace the system.net/mailSetting your myParam.config must only held
the section you want to replace. In your case without <system.net>
<mailSettings>
<smtp deliveryMethod="network">
<network
host="mail.host.com"
port="25"
defaultCredentials="true"
/>
</smtp>
</mailSettings>
Not sure if you are still experiencing this problem.
I was having no end of grief trying to use the web.config section replacement, especially when working with Enterprise Library. I decided to swap out the entire config file instead, I also find this easier to maintain.
In my solution I have a Web.config (Debug), Web.Staging.config and Web.Release.config.
I edit the Deployment Project file directly. Right click on the Web Deployment Project and select Open Project File.
You will see the xml that represents the project. I added the following:
Thanks - I was still having the problem. Don't know how but I had gotten it to work once before but never since. Looks like this forum isn't monitored frequently..
[quote user="Albert Weinert"][quote user="Rasetti"]Hi!!
When I try to build a Web deployment project, if I want to replace the <compilation> section inside <system.web> I keep on getting this error: web.config(1): error WDP00002: missing section compilation.
[..]
Any idea on this??
system.web/compilation=myCompilation.config
Works great.
Can I ask, what is the content/format of myCompilation.config in this case?
VS 2005 Web Deployment Projects
My open source project Sea Turtle Batch Imapge Processor @ http://code.google.com/p/batch-image-watermark-processor/
[quote user="Albert Weinert"][quote user="Rasetti"]Hi!!
When I try to build a Web deployment project, if I want to replace the <compilation> section inside <system.web> I keep on getting this error: web.config(1): error WDP00002: missing section compilation.
[..]
Any idea on this??
system.web/compilation=myCompilation.config
Works great.
Can I ask, what is the content/format of myCompilation.config in this case?
Because I got "The format of a configSource file must be an element containing the name of the section. (C:\Work\MyProject\Debug\myCompilation.config line 10)" error. [^o)]
My open source project Sea Turtle Batch Imapge Processor @ http://code.google.com/p/batch-image-watermark-processor/
I have prob. with this apporach. My file dosent get swapped... Are your replacement files complete config files with the exception of the changes or just the changes you want to make?
The <Delete> tag seems to work because the file dosent show up if its there, but ends up on the server location if its not. BUT my web.config file is just the same, no changes.
I have placed the config file with the website/project (added new textfile with config extension), is that where the <Copy> tag looks for it?
Did you ever find a resolution to replacing your <mailSettings> section?
I have the same problem, and I've tried every combination of specifying 'mailSettings=releaseMailSettings.config', 'system.net/mailSettings=releaseMailSettings.config', etc. In the .config file I've tried including only the <mailSettings> elements and including
the '<system.net><mailSettings>...' elements as well.
No matter how I do it, I receive the same WDP00002: mission section compilation exception. The connectionStrings= sections works fine however.
Error : An error occurred creating the configuration section handler for urlrewritingnet: Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified.
I have also tried just replacing the <rewrites> section by changing the replacement config file to
Member
452 Points
280 Posts
Web.config file replacement
Apr 17, 2006 06:45 PM|Rasetti|LINK
When I try to build a Web deployment project, if I want to replace the <compilation> section inside <system.web> I keep on getting this error: web.config(1): error WDP00002: missing section compilation.
I've tried to use the whole system.web branch or just the compilation branch into the replacement file, with no luck.
Any idea on this??
Is there a source of documentation about web.config replacement best procedures? I couldn't find anything on the Internet.
Thanks!!
Juan
MCTS
Please remember to click "Mark as Answer" on this post if it helped you.
Member
60 Points
26 Posts
MVP
Re: Web.config file replacement
Apr 24, 2006 08:22 AM|Albert Weinert|LINK
system.web/compilation=myCompilation.config
Works great.
None
0 Points
4 Posts
Re: Web.config file replacement
Apr 25, 2006 10:35 AM|Yury Kravtsov|LINK
What about <system.net> section?
I store smtp parameters there but when I set system.net/mailSettings=myParam.config I recevied the following error:
C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets(613,9): error : web.config(1): error WDP00002: missing section system.net/mailSettings.
There is my web.config:
and there is myParam.config:
Thank in advance
Member
60 Points
26 Posts
MVP
Re: Web.config file replacement
Apr 28, 2006 01:25 PM|Albert Weinert|LINK
You can exchange every section.
None
0 Points
3 Posts
Re: Web.config file replacement
Jun 21, 2006 03:32 PM|vamail2|LINK
I really need your help.
I am following the directions but this just isn't working for me - I get the same error WPD error - can you help?
ERROR:
----------------------------------------------------------
C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\aspnet_merge.exe C:\precompile\ClientSurvey1_deploy -o ClientSurvey1 -debug -copyattrs
Successfully merged 'C:\precompile\ClientSurvey1_deploy'.
Updating web.config: RootPath = C:\precompile\ClientSurvey1_deploy\, ValidateSections = False, UseExternalConfigSource = False
C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets(513,9): error : web.config(1): error WDP00002: missing section system.web/compilation.
Update of web.config Failed.
Web.config
-----------------------------------------------
<system.web>
<
pages styleSheetTheme="White"/><customErrors mode="Off"/>
<compilation debug="false">
:
:
</compilation >
"webconfigCompilation.config"
-----------------------------------------------
<
compilation debug="false" />Web Deployment Project:
---------------------------------------------
system.web/compilation=webconfigCompilation.config;
Thanks in advance
None
0 Points
39 Posts
Re: Web.config file replacement
Jul 27, 2006 01:57 PM|egorush|LINK
Not sure if you are still experiencing this problem.
I was having no end of grief trying to use the web.config section replacement, especially when working with Enterprise Library. I decided to swap out the entire config file instead, I also find this easier to maintain.
In my solution I have a Web.config (Debug), Web.Staging.config and Web.Release.config.
I edit the Deployment Project file directly. Right click on the Web Deployment Project and select Open Project File.
You will see the xml that represents the project. I added the following:
This replaces the entire Web.config and then deletes the unneeded files.
Hope this help.
abannayan@mac.com
None
0 Points
3 Posts
Re: Web.config file replacement
Jul 27, 2006 04:45 PM|vamail2|LINK
Thanks for ideas! I'll try that too.
None
0 Points
40 Posts
Re: Web.config file replacement
Aug 07, 2006 11:38 AM|jazzman42379|LINK
egorush - Great idea! I've been having issues with the replacements; it couldn't load my custom config sections...this sure makes it simpler!
Possibly as a feature request in a future version of the deployment project...a way to edit the build events in the UI?
Thanks,
John
Member
5 Points
58 Posts
Re: Web.config file replacement
Sep 06, 2006 03:47 PM|hardywang|LINK
[quote user="Albert Weinert"][quote user="Rasetti"]Hi!!
When I try to build a Web deployment project, if I want to replace the <compilation> section inside <system.web> I keep on getting this error: web.config(1): error WDP00002: missing section compilation.
[..]
Any idea on this??
system.web/compilation=myCompilation.config
Works great.
Can I ask, what is the content/format of myCompilation.config in this case?
VS 2005 Web Deployment Projects
Hardy
Member
5 Points
58 Posts
Re: Web.config file replacement
Sep 06, 2006 04:01 PM|hardywang|LINK
[quote user="Albert Weinert"][quote user="Rasetti"]Hi!!
When I try to build a Web deployment project, if I want to replace the <compilation> section inside <system.web> I keep on getting this error: web.config(1): error WDP00002: missing section compilation.
[..]
Any idea on this??
system.web/compilation=myCompilation.config
Works great.
Can I ask, what is the content/format of myCompilation.config in this case?
Because I got "The format of a configSource file must be an element containing the name of the section. (C:\Work\MyProject\Debug\myCompilation.config line 10)" error. [^o)]
Hardy
None
0 Points
1 Post
Re: Web.config file replacement
Aug 27, 2007 05:54 AM|mountainmikey|LINK
I have prob. with this apporach. My file dosent get swapped... Are your replacement files complete config files with the exception of the changes or just the changes you want to make?
The <Delete> tag seems to work because the file dosent show up if its there, but ends up on the server location if its not. BUT my web.config file is just the same, no changes.
I have placed the config file with the website/project (added new textfile with config extension), is that where the <Copy> tag looks for it?
Best regards
Mikael
None
0 Points
1 Post
Re: Web.config file replacement
Apr 06, 2008 08:10 PM|Glock23Man|LINK
Hi Rasetti,
Did you ever find a resolution to replacing your <mailSettings> section?
I have the same problem, and I've tried every combination of specifying 'mailSettings=releaseMailSettings.config', 'system.net/mailSettings=releaseMailSettings.config', etc. In the .config file I've tried including only the <mailSettings> elements and including the '<system.net><mailSettings>...' elements as well.
No matter how I do it, I receive the same WDP00002: mission section compilation exception. The connectionStrings= sections works fine however.
Cheers,
Scott
None
0 Points
1 Post
Re: Web.config file replacement
Jun 29, 2008 01:47 AM|londonali|LINK
I have it working this way:
Deployment setting
system.net/mailSettings/smtp=Configurations\DEV\systemNet_mailSettings_smtp_DEV.config;
My Replacement config file
<smtp deliveryMethod="PickupDirectoryFromIis" from="username@server.co.uk">
<network host="smtp.server.co.uk" password="xxxx" port="123" userName="username" />
</smtp>
My problem now is when I add a custom configSection
My web.config looks like this:
<configSections>
<section name="mySection" type="MyProject.MySectionClass, __code"/>
</configSections> <mySection defaultConnectionStringName="LocalSqlServer">
<mySubSection mailto=”meTest”>
</mySection>
And my replacement file is
<mySubSection mailto="meProd"/>
Deployment setting
mySubSection=Configurations\PROD\mySubSection_PROD.config
but obviously it is wrong as I get the web.config(1) error too.
Anyone had any luck with the custom configSections?
configSections Web Deployment WebConfigReplacementFiles
None
0 Points
1 Post
Re: Web.config file replacement
Aug 01, 2008 03:02 PM|NpnDan|LINK
Looks like you are not closing out your subsection in your web.config ....
<mySubSection mailto=”meTest”>
instead of
<mySubSection mailto=”meTest” />
The replacement process has to know where to start and end to do the replacement.
Member
41 Points
40 Posts
Re: Web.config file replacement
Feb 05, 2009 11:19 AM|tomliversidge|LINK
I am getting an error when I am trying to replace a urlrewritingnet section of my webconfig:
web config:
<urlrewritingnet rewriteOnlyVirtualUrls="true" contextItemsPrefix="QueryString" defaultPage="Default.aspx" defaultProvider="RegEx" xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>
<add name="PublishPortfolio2" virtualUrl="^https\://urlhere/(.*).aspx" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/public/Default.aspx?username=$1" rewrite="Domain" ignoreCase="true"/>
<add name="PublishPortfolio1" virtualUrl="^https\://urlhere/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/public/Default.aspx?username=$1" rewrite="Domain" ignoreCase="true"/>
</rewrites>
</urlrewritingnet>
Web Deployment file:
<WebConfigReplacementFiles Include="config\live_urlrewriting.config">
<Section>urlrewritingnet</Section>
</WebConfigReplacementFiles>
Error : An error occurred creating the configuration section handler for urlrewritingnet: Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified.
I have also tried just replacing the <rewrites> section by changing the replacement config file to
<rewrites>
<add name="PublishPortfolio2" virtualUrl="^https\://urlhere/(.*).aspx" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/public/Default.aspx?username=$1" rewrite="Domain" ignoreCase="true"/>
<add name="PublishPortfolio1" virtualUrl="^https\://urlhere/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/public/Default.aspx?username=$1" rewrite="Domain" ignoreCase="true"/>
</rewrites>
and the web deployment file to
<WebConfigReplacementFiles Include="config\live_urlrewriting.config">
<Section>urlrewritingnet/rewrites</Section>
</WebConfigReplacementFiles>
but this produces the WDP00002 section not found error.
any help appreciated