Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

web.config section replacement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck P - 01 Aug 2007 23:22 GMT
I replace a lot of web.config sections during compile.
I am having trouble with a custom section is it possible to replace a custom
section?

Error     44         web.config(1): error WDP00002: missing section
ExceptionHandler.                       1          1            
CriticalSkills_deploy



<sectionGroup name="ExceptionHandler">

     <section name="eMail"
type="System.Configuration.SingleTagSectionHandler"
restartOnExternalChanges="true"/>

     <section name="ContactInfo"
type="System.Configuration.SingleTagSectionHandler"
restartOnExternalChanges="true"/>

   </sectionGroup>



<!-- Error Handler Configuration Settings -->

 <ExceptionHandler>

   <eMail connectionStringName="cnnMailQueue" emailTo="aamntz@lanl.gov"/>

   <ContactInfo contactText="criticalskills@lanl.gov"/>

 </ExceptionHandler>
Steven Cheng[MSFT] - 02 Aug 2007 08:36 GMT
Hi Chuck,

Regarding on this web deployment project "section replacement" with custom
section handler issue, I've performed some local test and did repro the
same behavior you mentioned.  After some further research, I found that the
problem is due to the MSBUILD engine will use configuration API to process
the web.config file(to do the section replacement), that means if you're
using custom section handler, the msbuild app need to be able to locate the
custom section handler's assembly. And for custom section handlers in a
custom private assembly(in application's bin dir), msbuild won't be able to
locate it. Here is a web thread on forum mentioned the same issue:

http://forums.asp.net/t/1062816.aspx

and currently, some possible workaround options are available:

** strongname the custom seciton handler asembly and put it into GAC so
that msbuild engine can locate it

** instead of section replacement(of web deployment project), you can use
"configSource" attribute of web.config (ASP.NET 2.0 specific) to specify a
section's content in a separate file.

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
   

This posting is provided "AS IS" with no warranties, and confers no rights.
Chuck P - 06 Aug 2007 15:40 GMT
Thanks Steven,
I think I'll search around for an msbuild xml replacement task and see if I
can do it that way.
Steven Cheng[MSFT] - 07 Aug 2007 03:59 GMT
Thanks for your followup Chuck,

For the current built-in WDP's limitation, I suggest you submit it on our
product feedback site:

http://connect.microsoft.com/feedback/default.aspx?SiteID=210

Also, for custom MSBUILD tasks, I would recommend the following open source
community project which provides many custom tasks:

#community tasks project
http://msbuildtasks.com/default.aspx

In addition, here is a web article introduce creaeting a custom msbuild
task to modify a certain xml configuration file.

#Using Custom Tasks in MSBuild to modify XML Configuration Files on the Fly
http://www.c-sharpcorner.com/UploadFile/mgold/MSBuildForXml07282006005222AM/
MSBuildForXml.aspx?ArticleID=f1f4249b-171b-4cbc-82eb-83da9c1820ad

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
   

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.