Access to restricted folder

I have configured my app to use sql membership provider. I have a sub folder
which has specified pages to allow access to restricted users. When I ran the
application, I get this error: It is an error to use a section registered as
allow definition='Machineapplication' beyond application level, This error
can be caused by virtual directory not configured as virtual application.

Please try above code to see if it works. If it does, please then check if
some other elements are added in it. For example, if I add the membership
element it will throw following exception:

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.

Source Error:

Line 30: <system.web>
Line 31:
Line 32: <membership defaultProvider="MyProvider1"
userIsOnlineTimeWindow="15">
Line 33: <providers>
Line 34: <clear/>

From the above information we can see the memberhip element is the culprit

Please check it to see what the culprit is and let me know if you need
further assistance. Besides, here's a related post in the ASP.NET forum:http://forums.asp.net/t/769696.aspx

Regards,
Allen Chen
Microsoft Online Community 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:.

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) athttp://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Thanks for your help. I have added the authorization element to web config in
the sub folder and things are working. What is the difference beteeen this
approach and using the Security Admin tool. My next step to extend this
functionality to other pages within the restricted folder, but I can only get
one page to open for folder.
Any suggestions

Thanks

Alex

"Allen Chen [MSFT]" wrote:
> Hi Alex,
>
> This exception is generally caused by the fact that the web.config file in
> the sub folder is not correctly configured. Ideally the web.config should
> only contain authorization element, as below:
>
> <?xml version="1.0" encoding="utf-8"?>
> <configuration>
> <system.web>
> <authorization>
> <allow users="Test1" />
> <deny users="Test2" />
> </authorization>
> </system.web>
> </configuration>
>
> Please try above code to see if it works. If it does, please then check if
> some other elements are added in it. For example, if I add the membership
> element it will throw following exception:
>
> Parser Error Message: It is an error to use a section registered as
> allowDefinition='MachineToApplication' beyond application level. This
> error can be caused by a virtual directory not being configured as an
> application in IIS.
>
> Source Error:
>
>
> Line 30: <system.web>
> Line 31:
> Line 32: <membership defaultProvider="MyProvider1"
> userIsOnlineTimeWindow="15">
> Line 33: <providers>
> Line 34: <clear/>
>
>
> Source File: C:\Inetpub\wwwroot\membershiperror\test\web.config Line: 32
>
> From the above information we can see the memberhip element is the culprit
>
> Please check it to see what the culprit is and let me know if you need
> further assistance. Besides, here's a related post in the ASP.NET forum:
> http://forums.asp.net/t/769696.aspx
>
>
> Regards,
> Allen Chen
> Microsoft Online Community 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:
> .
>
> ==================================================
> 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/default.aspx?target=assistance&ln=en-us.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> --------------------
> | Thread-Topic: Access to restricted folder
> | thread-index: AckijjpD9u5DdRUiR/CQZMFfKpOPhg==
> | X-WBNR-Posting-Host: 65.55.21.8
> | From: =?Utf-8?B?QWxleC4gTy4gS29yYW50ZW5n?= <>
> | Subject: Access to restricted folder
> | Date: Mon, 29 Sep 2008 16:51:01 -0700
> | Lines: 5
> | Message-ID: <>
> | 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.security
> | Path: TK2MSFTNGHUB02.phx.gbl
> | Xref: TK2MSFTNGHUB02.phx.gbl
> microsoft.public.dotnet.framework.aspnet.security:2681
> | NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
> |
> | I have configured my app to use sql membership provider. I have a sub
> folder
> | which has specified pages to allow access to restricted users. When I ran
> the
> | application, I get this error: It is an error to use a section registered
> as
> | allow definition='Machineapplication' beyond application level, This
> error
> | can be caused by virtual directory not configured as virtual application.
> |
>
>

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!