Last post Aug 29, 2015 07:22 PM by zoltac007
Aug 28, 2015 09:46 PM|zoltac007|LINK
Our website code is all running properly but Visual Studio Community 2015 cannot display any of our .aspx pages in Design view apparently due to error below. When Design view is requested Master Page Error displays with message "The Master Page file '~/....[all
of our master page files] ........' cannot be loaded. We have login code on all master pages which is calls the AspNetSqlMembershipProvider. The website functions fully ONLINE and login functions work. The only problem we have is rendering them in Visual
Studio Design view. When using Visual Studio for Web 2012 and running under Windows Server 2003 the Design view worked fine. Problem occurred when we migrated to a Windows Server 2012 VM hosting. We are using FTP to access website code.
ERROR MESSAGE DISPLAYED by Visual Studio for all of our .aspx pages.
ASP.NET runtime error: 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. Calls out Line 147 web.config
This is the code beginning at Line 147.
<membership defaultProvider="AspNetSqlMembershipProvider"> <providers> <clear/> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalDBConnectionString" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0"
requiresQuestionAndAnswer="false" applicationName="membershipSampleApp"/> </providers> </membership>
Aug 29, 2015 10:38 AM|Careed|LINK
This simply means that you are trying use application-only configuration settings in a web page contained inside a "virtual" directory.
You need to convert your virtual directory to an application in IIS and then it will work properly.
Aug 29, 2015 01:55 PM|zoltac007|LINK
Question - we have two websites. One does not use the AspSQLMembershipProvider and it loads fine and the .aspx Display View works when using Visual Studio Community 2015 on a Windows 2012 Server host. The other website that has the "AspSQLMembershipProvider"
in the web.config generates the error. Same server.
It there a specific "virtual" directory where the AspSQLMembershipProvider resides that needs to be converted?
Aug 29, 2015 04:36 PM|Careed|LINK
If you have a web.config file containing a membership element that is not in an application, then you will receive this error. In general, it means that the web.config does not reside in a folder that has been made an application and that it is still only
a virtual (or physical that behaves like a virtual) folder.
This could also be a problem if you put a web.config in a subfolder of an application that contains application-specific elements. You would need to move these elements up to the application-level web.config file.
You can have a website that is contained inside a virtual directory within your website as long as the web.config it contains does not require for it to be an application given the elements contained inside the web.config file.
Aug 29, 2015 07:22 PM|zoltac007|LINK
Thank you for the explanation. I will compare folder settings of the two server instances.