WebConfigurationManager.GetSection in Medium Trust

Discussion in 'ASP .Net' started by Roger Martin, Aug 3, 2008.

  1. Roger Martin

    Roger Martin Guest

    Is it possible for a medium trust web application to read the Membership
    providers? The following throws a SecurityException:

    MembershipSection membershipSection =
    (MembershipSection)WebConfigurationManager.GetSection("system.web/membership");

    I have custom sections in my web.config where I specify
    requirePermission="false", which allows them to be read in medium trust, but
    it does not seem possible to do this for the membership section. When I
    attempt it, like putting the following at the top of web.config...

    <section name="membership" type="System.Web.Configuration.MembershipSection,
    System.Web" allowDefinition="MachineToApplication" requirePermission="false"
    />

    ....I get the error "There is a duplicate 'system.web/membership' section
    defined". I understand it may be possible to get around this by editing the
    machine-level web.config so that allowOverride="true", but this is not an
    option in my case, as I am developing a web application for wide
    distribution, and I do not want to require my users to edit the machine-level
    web.config.

    Thanks,
    Roger Martin
    Gallery Server Pro (http://www.galleryserverpro.com)
    Roger Martin, Aug 3, 2008
    #1
    1. Advertising

  2. Roger Martin

    Roger Martin Guest

    Bump. I am an MSDN subscriber, and I am under the impression someone from
    Microsoft will answer this within two business days, but that time has
    passed. Am I misunderstanding something?

    Thanks,
    Roger

    "Roger Martin" wrote:

    > Is it possible for a medium trust web application to read the Membership
    > providers?
    Roger Martin, Aug 6, 2008
    #2
    1. Advertising

  3. re:
    !> Bump. I am an MSDN subscriber, and I am under the impression someone from
    !> Microsoft will answer this within two business days, but that time has
    !> passed. Am I misunderstanding something?

    Did you register your posting address with MSDN ?
    Unless you did, they have no way to assign priority to your question.




    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/
    ======================================
    "Roger Martin" <Roger am> wrote in message
    news:...
    > Bump. I am an MSDN subscriber, and I am under the impression someone from
    > Microsoft will answer this within two business days, but that time has
    > passed. Am I misunderstanding something?
    >
    > Thanks,
    > Roger
    >
    > "Roger Martin" wrote:
    >
    >> Is it possible for a medium trust web application to read the Membership
    >> providers?
    Juan T. Llibre, Aug 6, 2008
    #3
  4. Roger Martin

    Roger Martin Guest

    That may be the issue. Unfortunately, the web site is not working for
    configuring the e-mail alias, so I had to create a support incident that may
    take a few days to sort out. Meanwhile, if anyone can address the original
    question, I sure would appreciate it!

    Roger

    "Juan T. Llibre" wrote:

    > re:
    > !> Bump. I am an MSDN subscriber, and I am under the impression someone from
    > !> Microsoft will answer this within two business days, but that time has
    > !> passed. Am I misunderstanding something?
    >
    > Did you register your posting address with MSDN ?
    > Unless you did, they have no way to assign priority to your question.
    >
    >
    >
    >
    > 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/
    > ======================================
    > "Roger Martin" <Roger am> wrote in message
    > news:...
    > > Bump. I am an MSDN subscriber, and I am under the impression someone from
    > > Microsoft will answer this within two business days, but that time has
    > > passed. Am I misunderstanding something?
    > >
    > > Thanks,
    > > Roger
    > >
    > > "Roger Martin" wrote:
    > >
    > >> Is it possible for a medium trust web application to read the Membership
    > >> providers?

    >
    >
    >
    Roger Martin, Aug 7, 2008
    #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. Paul Hatcher

    Medium Level Trust and Reflection

    Paul Hatcher, Feb 25, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    478
    Paul Hatcher
    Feb 25, 2005
  2. Michael Howes
    Replies:
    0
    Views:
    481
    Michael Howes
    Jan 26, 2006
  3. =?Utf-8?B?TWFyayBMZWlzdG5lcg==?=

    Does GridView.DataBind work under medium trust with custom objects

    =?Utf-8?B?TWFyayBMZWlzdG5lcg==?=, Aug 22, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    503
    =?Utf-8?B?TWFyayBMZWlzdG5lcg==?=
    Aug 23, 2006
  4. Roger Martin
    Replies:
    1
    Views:
    585
    Roger Martin
    Aug 22, 2008
  5. Linda
    Replies:
    1
    Views:
    537
    Dominick Baier
    Aug 31, 2006
Loading...

Share This Page