Conflicing My.MySettings sections in web.config files

Discussion in 'ASP .Net' started by cmay, Jul 18, 2007.

  1. cmay

    cmay Guest

    I have an asp.net application at the root, and other applications
    suchs as /WebApp1, /WebApp2.

    By design, these web applications inherit the root application's
    web.config file.

    But, when you create a Web Reference, to a webservice, it creates a
    section in your web.config file "My.MySettings" to hold the URL of the
    webservice.

    If your root application uses a webservice, and if one of your other
    applications uses one, then asp.net has problems because both
    web.config files try to define a My.MySettings section in the
    web.config files.

    This is not limited to webservices, this section is created if you try
    to make use of the settings tab of the project.

    Does anyone know of of anything that can be done about this?

    If I am unclear I can post examples or more details.
     
    cmay, Jul 18, 2007
    #1
    1. Advertising

  2. re:
    !> But, when you create a Web Reference, to a webservice, it creates a
    !> section in your web.config file "My.MySettings" to hold the URL of the webservice.

    Sounds like a bug.

    My exposes only those objects required by a particular project type.

    For example, the My.Forms object is available in a Windows Forms
    application but not available in a console application.

    My.Settings does not apply to web sites.

    See a table with all the "My" objects exposed in project types :

    http://msdn2.microsoft.com/en-us/library/ms172698(VS.80).aspx




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ======================================
    "cmay" <> wrote in message news:...
    >I have an asp.net application at the root, and other applications
    > suchs as /WebApp1, /WebApp2.
    >
    > By design, these web applications inherit the root application's
    > web.config file.
    >
    > But, when you create a Web Reference, to a webservice, it creates a
    > section in your web.config file "My.MySettings" to hold the URL of the
    > webservice.
    >
    > If your root application uses a webservice, and if one of your other
    > applications uses one, then asp.net has problems because both
    > web.config files try to define a My.MySettings section in the
    > web.config files.
    >
    > This is not limited to webservices, this section is created if you try
    > to make use of the settings tab of the project.
    >
    > Does anyone know of of anything that can be done about this?
    >
    > If I am unclear I can post examples or more details.
    >
     
    Juan T. Llibre, Jul 18, 2007
    #2
    1. Advertising

  3. cmay

    cmay Guest

    "My.Settings does not apply to web sites. "

    For web applications, you can add settings at the project level.

    They are stored in the web.config and accessible from My.Settings.
     
    cmay, Aug 7, 2007
    #3
    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. =?Utf-8?B?VG90eSBTYW50YW5h?=

    replace web.config sections using MSBuild

    =?Utf-8?B?VG90eSBTYW50YW5h?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    3,420
    Steven Cheng[MSFT]
    Apr 6, 2006
  2. Replies:
    3
    Views:
    443
  3. Raman
    Replies:
    6
    Views:
    4,726
    santosh
    Aug 3, 2007
  4. Monty
    Replies:
    1
    Views:
    3,588
    Walter Wang [MSFT]
    Oct 25, 2007
  5. Olivier MATROT

    Unable to encrypt some sections in web.config

    Olivier MATROT, Oct 4, 2007, in forum: ASP .Net Security
    Replies:
    2
    Views:
    198
    Olivier MATROT
    Oct 4, 2007
Loading...

Share This Page