web.config section replacement

Discussion in 'ASP .Net' started by =?Utf-8?B?Q2h1Y2sgUA==?=, Aug 1, 2007.

  1. 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=""/>

    <ContactInfo contactText=""/>

    </ExceptionHandler>
     
    =?Utf-8?B?Q2h1Y2sgUA==?=, Aug 1, 2007
    #1
    1. Advertising

  2. 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.
     
    Steven Cheng[MSFT], Aug 2, 2007
    #2
    1. Advertising

  3. Thanks Steven,
    I think I'll search around for an msbuild xml replacement task and see if I
    can do it that way.
     
    =?Utf-8?B?Q2h1Y2sgUA==?=, Aug 6, 2007
    #3
  4. 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.
     
    Steven Cheng[MSFT], Aug 7, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. clintonG
    Replies:
    4
    Views:
    376
    clintonG
    Aug 24, 2006
  2. CSharpner
    Replies:
    0
    Views:
    1,094
    CSharpner
    Apr 9, 2007
  3. =?Utf-8?B?RHVrZSAoQU4yNDcp?=

    Web deployment project - config section replacement files

    =?Utf-8?B?RHVrZSAoQU4yNDcp?=, Aug 31, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    560
    Steven Cheng[MSFT]
    Sep 3, 2007
  4. Ira Grollman
    Replies:
    0
    Views:
    152
    Ira Grollman
    Nov 26, 2007
  5. kampy
    Replies:
    9
    Views:
    353
    Steven D'Aprano
    Oct 19, 2012
Loading...

Share This Page