473,408 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Get data from Local Web.config not machine.config

I have a app that uses several membership/role providers. I can list these
Providers with the code:
Dim rootWebConfig1 As Configuration
rootWebConfig1 =
WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath)
Dim section As New MembershipSection
section = rootWebConfig1.GetSection("system.web/membership")

Using the Immediate Window :

? section.Providers(0).Name
"AspNetSqlMembershipProvider"
? section.Providers(1).Name
"MemberProv1"
? section.Providers(2).Name
"ADProvider1"

As you can see I can list the providers but the Provider
AspNetSqlMembershipProvider" is in the machine.config I do not have control
over the machine config at all my sites so I want to get the Providers only
from the web.config in my application.

How do I do this.

Thank you
--
Jerry
Oct 22 '08 #1
5 2838
Hi Jerry,

We can read the web.config directly. Please refer to my reply in this post:

http://thesource.ofallevil.com/commu...us/default.asp
x?dg=microsoft.public.dotnet.framework.aspnet&tid= 0e140c7e-d85d-47bc-bcba-52
35731b9edb&cat=en_us_10ca9291-071d-4a5d-ba07-3a2422fddf6a&lang=en&cr=us&sloc
=&p=1

If it's not what you need please let me know and clarify your requirement.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can

improve the support we provide to you. Please feel free to let my manager
know what you think of the

level of service provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-

us/subscriptions/aa948868.aspx#notifications.

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://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: Get data from Local Web.config not machine.config
| thread-index: Ack0dMPG5k4uZE29T5SP1nO/sd0qAQ==
| X-WBNR-Posting-Host: 65.55.21.8
| From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| Subject: Get data from Local Web.config not machine.config
| Date: Wed, 22 Oct 2008 11:34:06 -0700
| Lines: 29
| Message-ID: <97**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78389
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a app that uses several membership/role providers. I can list
these
| Providers with the code:
| Dim rootWebConfig1 As Configuration
| rootWebConfig1 =
| WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath)
| Dim section As New MembershipSection
| section = rootWebConfig1.GetSection("system.web/membership")
|
|
|
| Using the Immediate Window :
|
| ? section.Providers(0).Name
| "AspNetSqlMembershipProvider"
| ? section.Providers(1).Name
| "MemberProv1"
| ? section.Providers(2).Name
| "ADProvider1"
|
| As you can see I can list the providers but the Provider
| AspNetSqlMembershipProvider" is in the machine.config I do not have
control
| over the machine config at all my sites so I want to get the Providers
only
| from the web.config in my application.
|
| How do I do this.
|
| Thank you
| --
| Jerry
|

Oct 23 '08 #2
Allen,

Thank you for your reply,

I was hopping that the Configuration objects would have some funcions that
only read the sections in the local config file only and not the machine
config. The Membership and role sections may contain passwords so I planned
to encript them in some installations. This would make using the xml reader
and stream reader more complax. If I cannot get a list of Membership and Role
providers only from the local config file I can put a list of the providers
in the appSettings section. This makes the application setup more complex but
may be necessary.

Thank you
--
Jerry
"Allen Chen [MSFT]" wrote:
Hi Jerry,

We can read the web.config directly. Please refer to my reply in this post:

http://thesource.ofallevil.com/commu...us/default.asp
x?dg=microsoft.public.dotnet.framework.aspnet&tid= 0e140c7e-d85d-47bc-bcba-52
35731b9edb&cat=en_us_10ca9291-071d-4a5d-ba07-3a2422fddf6a&lang=en&cr=us&sloc
=&p=1

If it's not what you need please let me know and clarify your requirement.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can

improve the support we provide to you. Please feel free to let my manager
know what you think of the

level of service provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-

us/subscriptions/aa948868.aspx#notifications.

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://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: Get data from Local Web.config not machine.config
| thread-index: Ack0dMPG5k4uZE29T5SP1nO/sd0qAQ==
| X-WBNR-Posting-Host: 65.55.21.8
| From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| Subject: Get data from Local Web.config not machine.config
| Date: Wed, 22 Oct 2008 11:34:06 -0700
| Lines: 29
| Message-ID: <97**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78389
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a app that uses several membership/role providers. I can list
these
| Providers with the code:
| Dim rootWebConfig1 As Configuration
| rootWebConfig1 =
| WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath)
| Dim section As New MembershipSection
| section = rootWebConfig1.GetSection("system.web/membership")
|
|
|
| Using the Immediate Window :
|
| ? section.Providers(0).Name
| "AspNetSqlMembershipProvider"
| ? section.Providers(1).Name
| "MemberProv1"
| ? section.Providers(2).Name
| "ADProvider1"
|
| As you can see I can list the providers but the Provider
| AspNetSqlMembershipProvider" is in the machine.config I do not have
control
| over the machine config at all my sites so I want to get the Providers
only
| from the web.config in my application.
|
| How do I do this.
|
| Thank you
| --
| Jerry
|

Oct 23 '08 #3
Hi Jerry,

I really understand you may feel inconvenience that we cannot get
AspNetSqlMembershipProvider in an easier way. You're welcome to submit a
feedback here:

https://connect.microsoft.com/Visual...?wa=wsignin1.0

Our development team will take into consideration all suggestions and
feedback for future releases and updates. With efforts from customers, we
continue to make our products better.
Regards,
Allen Chen
Microsoft Online Support

--------------------
| Thread-Topic: Get data from Local Web.config not machine.config
| thread-index: Ack1Fa+36aDtinreT0GwbKzBZF9JKw==
| X-WBNR-Posting-Host: 207.46.192.207
| From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<EQ**************@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: Get data from Local Web.config not machine.config
| Date: Thu, 23 Oct 2008 06:46:01 -0700
| Lines: 133
| Message-ID: <1F**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78471
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Allen,
|
| Thank you for your reply,
|
| I was hopping that the Configuration objects would have some funcions
that
| only read the sections in the local config file only and not the machine
| config. The Membership and role sections may contain passwords so I
planned
| to encript them in some installations. This would make using the xml
reader
| and stream reader more complax. If I cannot get a list of Membership and
Role
| providers only from the local config file I can put a list of the
providers
| in the appSettings section. This makes the application setup more complex
but
| may be necessary.
|
| Thank you
| --
| Jerry
|
|
| "Allen Chen [MSFT]" wrote:
|
| Hi Jerry,
| >
| We can read the web.config directly. Please refer to my reply in this
post:
| >
| >
http://thesource.ofallevil.com/commu...us/default.asp
| >
x?dg=microsoft.public.dotnet.framework.aspnet&tid= 0e140c7e-d85d-47bc-bcba-52
| >
35731b9edb&cat=en_us_10ca9291-071d-4a5d-ba07-3a2422fddf6a&lang=en&cr=us&sloc
| =&p=1
| >
| If it's not what you need please let me know and clarify your
requirement.
| >
| Regards,
| Allen Chen
| Microsoft Online Support
| >
| Delighting our customers is our #1 priority. We welcome your comments
and
| suggestions about how we can
| >
| improve the support we provide to you. Please feel free to let my
manager
| know what you think of the
| >
| level of service provided. You can send feedback directly to my manager
at:
| ms****@microsoft.com.
| >
| ==================================================
| Get notification to my posts through email? Please refer to
| http://msdn.microsoft.com/en-
| >
| us/subscriptions/aa948868.aspx#notifications.
| >
| 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://support.microsoft.com/select/...tance&ln=en-us.
| ==================================================
| This posting is provided "AS IS" with no warranties, and confers no
rights.
| --------------------
| | Thread-Topic: Get data from Local Web.config not machine.config
| | thread-index: Ack0dMPG5k4uZE29T5SP1nO/sd0qAQ==
| | X-WBNR-Posting-Host: 65.55.21.8
| | From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| | Subject: Get data from Local Web.config not machine.config
| | Date: Wed, 22 Oct 2008 11:34:06 -0700
| | Lines: 29
| | Message-ID: <97**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Path: TK2MSFTNGHUB02.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:78389
| | NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | I have a app that uses several membership/role providers. I can list
| these
| | Providers with the code:
| | Dim rootWebConfig1 As Configuration
| | rootWebConfig1 =
| | WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath)
| | Dim section As New MembershipSection
| | section = rootWebConfig1.GetSection("system.web/membership")
| |
| |
| |
| | Using the Immediate Window :
| |
| | ? section.Providers(0).Name
| | "AspNetSqlMembershipProvider"
| | ? section.Providers(1).Name
| | "MemberProv1"
| | ? section.Providers(2).Name
| | "ADProvider1"
| |
| | As you can see I can list the providers but the Provider
| | AspNetSqlMembershipProvider" is in the machine.config I do not have
| control
| | over the machine config at all my sites so I want to get the
Providers
| only
| | from the web.config in my application.
| |
| | How do I do this.
| |
| | Thank you
| | --
| | Jerry
| |
| >
| >
|

Oct 24 '08 #4
Solution.

The problem is the application Inheritance. The app get information from the
machine.config.
All membership providers in machine.config are added to the membership
providers in the local web.config.

To solve this use the <clear/tag in the Membership section this will clear
all inherited membership providers for the app.

<membership >
<providers >
<clear />
<add name="MemberProv1" applicationName="/myapp"
connectionStringName="MemConnection1" requiresQuestionAndAnswer="false"
minRequiredPasswordLength="3" requiresUniqueEmail="false"
minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression=""
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="ADProvider1"
attributeMapUsername="sAMAccountName"
connectionStringName="ADConnectionString1" connectionUsername="rpaul"
connectionPassword="ajdoivmejr" enableSearchMethods="true"
type="System.Web.Security.ActiveDirectoryMembershi pProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
Then when I use:
Dim MemSection As New MembershipSection
Dim RoleSection As New RoleManagerSection
MemSection = rootWebConfig1.GetSection("system.web/membership")
RoleSection = rootWebConfig1.GetSection("system.web/roleManager")

RoleSection.Providers(0).Name or
Membership.Providers(0).Name

I will only get RoleProviders or Membership providers from my web.config

I will not use Providers from the machine config. in the app.

Thank you,

--
Jerry
"Allen Chen [MSFT]" wrote:
Hi Jerry,

I really understand you may feel inconvenience that we cannot get
AspNetSqlMembershipProvider in an easier way. You're welcome to submit a
feedback here:

https://connect.microsoft.com/Visual...?wa=wsignin1.0

Our development team will take into consideration all suggestions and
feedback for future releases and updates. With efforts from customers, we
continue to make our products better.
Regards,
Allen Chen
Microsoft Online Support

--------------------
| Thread-Topic: Get data from Local Web.config not machine.config
| thread-index: Ack1Fa+36aDtinreT0GwbKzBZF9JKw==
| X-WBNR-Posting-Host: 207.46.192.207
| From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<EQ**************@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: Get data from Local Web.config not machine.config
| Date: Thu, 23 Oct 2008 06:46:01 -0700
| Lines: 133
| Message-ID: <1F**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78471
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Allen,
|
| Thank you for your reply,
|
| I was hopping that the Configuration objects would have some funcions
that
| only read the sections in the local config file only and not the machine
| config. The Membership and role sections may contain passwords so I
planned
| to encript them in some installations. This would make using the xml
reader
| and stream reader more complax. If I cannot get a list of Membership and
Role
| providers only from the local config file I can put a list of the
providers
| in the appSettings section. This makes the application setup more complex
but
| may be necessary.
|
| Thank you
| --
| Jerry
|
|
| "Allen Chen [MSFT]" wrote:
|
| Hi Jerry,
| >
| We can read the web.config directly. Please refer to my reply in this
post:
| >
| >
http://thesource.ofallevil.com/commu...us/default.asp
| >
x?dg=microsoft.public.dotnet.framework.aspnet&tid= 0e140c7e-d85d-47bc-bcba-52
| >
35731b9edb&cat=en_us_10ca9291-071d-4a5d-ba07-3a2422fddf6a&lang=en&cr=us&sloc
| =&p=1
| >
| If it's not what you need please let me know and clarify your
requirement.
| >
| Regards,
| Allen Chen
| Microsoft Online Support
| >
| Delighting our customers is our #1 priority. We welcome your comments
and
| suggestions about how we can
| >
| improve the support we provide to you. Please feel free to let my
manager
| know what you think of the
| >
| level of service provided. You can send feedback directly to my manager
at:
| ms****@microsoft.com.
| >
| ==================================================
| Get notification to my posts through email? Please refer to
| http://msdn.microsoft.com/en-
| >
| us/subscriptions/aa948868.aspx#notifications.
| >
| 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://support.microsoft.com/select/...tance&ln=en-us.
| ==================================================
| This posting is provided "AS IS" with no warranties, and confers no
rights.
| --------------------
| | Thread-Topic: Get data from Local Web.config not machine.config
| | thread-index: Ack0dMPG5k4uZE29T5SP1nO/sd0qAQ==
| | X-WBNR-Posting-Host: 65.55.21.8
| | From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| | Subject: Get data from Local Web.config not machine.config
| | Date: Wed, 22 Oct 2008 11:34:06 -0700
| | Lines: 29
| | Message-ID: <97**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Path: TK2MSFTNGHUB02.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:78389
| | NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | I have a app that uses several membership/role providers. I can list
| these
| | Providers with the code:
| | Dim rootWebConfig1 As Configuration
| | rootWebConfig1 =
| | WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath)
| | Dim section As New MembershipSection
| | section = rootWebConfig1.GetSection("system.web/membership")
| |
| |
| |
| | Using the Immediate Window :
| |
| | ? section.Providers(0).Name
| | "AspNetSqlMembershipProvider"
| | ? section.Providers(1).Name
| | "MemberProv1"
| | ? section.Providers(2).Name
| | "ADProvider1"
| |
| | As you can see I can list the providers but the Provider
| | AspNetSqlMembershipProvider" is in the machine.config I do not have
| control
| | over the machine config at all my sites so I want to get the
Providers
| only
| | from the web.config in my application.
| |
| | How do I do this.
| |
| | Thank you
| | --
| | Jerry
| |
| >
| >
|

Oct 24 '08 #5
Hi Jerry,

Glad to know that you've find the solution yourself. If there's no need to
use the configurations set in the machine.config it's a proper solution to
clear them in our web.config. If we have to use them probably we have to
read the web.config ourselves.
If you have other questions welcome to send them in the newsgroup. I'm
willing to help.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| Thread-Topic: Get data from Local Web.config not machine.config
| thread-index: Ack16Xp0rZcz5lo/S9qLOrIx5oVB4Q==
| X-WBNR-Posting-Host: 207.46.192.207
| From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<EQ**************@TK2MSFTNGHUB02.phx.gbl>
<1F**********************************@microsoft.co m>
<a6**************@TK2MSFTNGHUB02.phx.gbl>
| Subject: RE: Get data from Local Web.config not machine.config
| Date: Fri, 24 Oct 2008 08:02:05 -0700
| Lines: 252
| Message-ID: <33**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3168
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:78568
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Solution.
|
| The problem is the application Inheritance. The app get information from
the
| machine.config.
| All membership providers in machine.config are added to the membership
| providers in the local web.config.
|
| To solve this use the <clear/tag in the Membership section this will
clear
| all inherited membership providers for the app.
|
| <membership >
| <providers >
| <clear />
| <add name="MemberProv1" applicationName="/myapp"
| connectionStringName="MemConnection1" requiresQuestionAndAnswer="false"
| minRequiredPasswordLength="3" requiresUniqueEmail="false"
| minRequiredNonalphanumericCharacters="0"
passwordStrengthRegularExpression=""
| type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0,
| Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
| <add name="ADProvider1"
| attributeMapUsername="sAMAccountName"
| connectionStringName="ADConnectionString1" connectionUsername="rpaul"
| connectionPassword="ajdoivmejr" enableSearchMethods="true"
| type="System.Web.Security.ActiveDirectoryMembershi pProvider, System.Web,
| Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
| </providers>
| </membership>
|
|
| Then when I use:
| Dim MemSection As New MembershipSection
| Dim RoleSection As New RoleManagerSection
| MemSection = rootWebConfig1.GetSection("system.web/membership")
| RoleSection = rootWebConfig1.GetSection("system.web/roleManager")
|
| RoleSection.Providers(0).Name or
| Membership.Providers(0).Name
|
| I will only get RoleProviders or Membership providers from my web.config
|
| I will not use Providers from the machine config. in the app.
|
| Thank you,
|
|
|
| --
| Jerry
|
|
| "Allen Chen [MSFT]" wrote:
|
| Hi Jerry,
| >
| I really understand you may feel inconvenience that we cannot get
| AspNetSqlMembershipProvider in an easier way. You're welcome to submit
a
| feedback here:
| >
| https://connect.microsoft.com/Visual...?wa=wsignin1.0
| >
| Our development team will take into consideration all suggestions and
| feedback for future releases and updates. With efforts from customers,
we
| continue to make our products better.
| >
| >
| Regards,
| Allen Chen
| Microsoft Online Support
| >
| --------------------
| | Thread-Topic: Get data from Local Web.config not machine.config
| | thread-index: Ack1Fa+36aDtinreT0GwbKzBZF9JKw==
| | X-WBNR-Posting-Host: 207.46.192.207
| | From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| | References: <97**********************************@microsoft.co m>
| <EQ**************@TK2MSFTNGHUB02.phx.gbl>
| | Subject: RE: Get data from Local Web.config not machine.config
| | Date: Thu, 23 Oct 2008 06:46:01 -0700
| | Lines: 133
| | Message-ID: <1F**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Path: TK2MSFTNGHUB02.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:78471
| | NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Allen,
| |
| | Thank you for your reply,
| |
| | I was hopping that the Configuration objects would have some funcions
| that
| | only read the sections in the local config file only and not the
machine
| | config. The Membership and role sections may contain passwords so I
| planned
| | to encript them in some installations. This would make using the xml
| reader
| | and stream reader more complax. If I cannot get a list of Membership
and
| Role
| | providers only from the local config file I can put a list of the
| providers
| | in the appSettings section. This makes the application setup more
complex
| but
| | may be necessary.
| |
| | Thank you
| | --
| | Jerry
| |
| |
| | "Allen Chen [MSFT]" wrote:
| |
| | Hi Jerry,
| | >
| | We can read the web.config directly. Please refer to my reply in
this
| post:
| | >
| | >
| >
http://thesource.ofallevil.com/commu...us/default.asp
| | >
| >
x?dg=microsoft.public.dotnet.framework.aspnet&tid= 0e140c7e-d85d-47bc-bcba-52
| | >
| >
35731b9edb&cat=en_us_10ca9291-071d-4a5d-ba07-3a2422fddf6a&lang=en&cr=us&sloc
| | =&p=1
| | >
| | If it's not what you need please let me know and clarify your
| requirement.
| | >
| | Regards,
| | Allen Chen
| | Microsoft Online Support
| | >
| | Delighting our customers is our #1 priority. We welcome your
comments
| and
| | suggestions about how we can
| | >
| | improve the support we provide to you. Please feel free to let my
| manager
| | know what you think of the
| | >
| | level of service provided. You can send feedback directly to my
manager
| at:
| | ms****@microsoft.com.
| | >
| | ==================================================
| | Get notification to my posts through email? Please refer to
| | http://msdn.microsoft.com/en-
| | >
| | us/subscriptions/aa948868.aspx#notifications.
| | >
| | 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://support.microsoft.com/select/...tance&ln=en-us.
| | ==================================================
| | This posting is provided "AS IS" with no warranties, and confers no
| rights.
| | --------------------
| | | Thread-Topic: Get data from Local Web.config not machine.config
| | | thread-index: Ack0dMPG5k4uZE29T5SP1nO/sd0qAQ==
| | | X-WBNR-Posting-Host: 65.55.21.8
| | | From: =?Utf-8?B?SmVycnkgQw==?= <je*****@nospam.nospam>
| | | Subject: Get data from Local Web.config not machine.config
| | | Date: Wed, 22 Oct 2008 11:34:06 -0700
| | | Lines: 29
| | | Message-ID: <97**********************************@microsoft.co m>
| | | MIME-Version: 1.0
| | | Content-Type: text/plain;
| | | charset="Utf-8"
| | | Content-Transfer-Encoding: 7bit
| | | X-Newsreader: Microsoft CDO for Windows 2000
| | | Content-Class: urn:content-classes:message
| | | Importance: normal
| | | Priority: normal
| | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | | Path: TK2MSFTNGHUB02.phx.gbl
| | | Xref: TK2MSFTNGHUB02.phx.gbl
| | microsoft.public.dotnet.framework.aspnet:78389
| | | NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| | |
| | | I have a app that uses several membership/role providers. I can
list
| | these
| | | Providers with the code:
| | | Dim rootWebConfig1 As Configuration
| | | rootWebConfig1 =
| | |
WebConfigurationManager.OpenWebConfiguration(Reque st.ApplicationPath)
| | | Dim section As New MembershipSection
| | | section = rootWebConfig1.GetSection("system.web/membership")
| | |
| | |
| | |
| | | Using the Immediate Window :
| | |
| | | ? section.Providers(0).Name
| | | "AspNetSqlMembershipProvider"
| | | ? section.Providers(1).Name
| | | "MemberProv1"
| | | ? section.Providers(2).Name
| | | "ADProvider1"
| | |
| | | As you can see I can list the providers but the Provider
| | | AspNetSqlMembershipProvider" is in the machine.config I do not
have
| | control
| | | over the machine config at all my sites so I want to get the
| Providers
| | only
| | | from the web.config in my application.
| | |
| | | How do I do this.
| | |
| | | Thank you
| | | --
| | | Jerry
| | |
| | >
| | >
| |
| >
| >
|

Oct 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kevin Vogt | last post by:
When initially loaded, my web application (below) takes ~120000 milliseconds to open its connection. But repeated executions take 0 milliseconds each. But when I wait for approx. 5 minutes and try...
8
by: JR | last post by:
I have a Web server running on Windows XP. On this Web server, I have a Web site configured with its home directory on a network share. In the Web site, there's a virtual folder pointing to a local...
2
by: DavidR | last post by:
Hi, My development machine is running Win XP SP2 and IIS. I'm developing an ASP.NET application on this machine that accesses data from a SQL Server database on another machine. That machine...
1
by: Nathan Sokalski | last post by:
I have retrieved data from a database using a SELECT statement that includes an INNER JOIN. The data seems to be retrieved to the DataSet OK, but I am having trouble getting the data from the...
5
by: rogsonl | last post by:
My computer was moved last week, and the company changed the network groups we work on. As a result, one of the main benefits from Whidbey (database connectivity) no longer works. Situation: 1....
2
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I...
3
by: asemeiks | last post by:
I'm using Access 97, Jet 4.0. the data resides on a Win 2000 domain server. Using .Net 1.1 and IIS 5.0 on a local XPPro computer I am trying connect to a Jet database on the server. If the data...
9
by: KarlM | last post by:
After reading some articles regarding confuguration data I'm a bit confused. Where is the right place for storing configuration data? - XML-files? - registry? - INI-files? (from a users point...
5
by: Mufasa | last post by:
How can you have different web.config files on your test machine vs. production? I realize I could not include it in the project but the problem is that if I make changes that go in both places I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.