I am new to DiscountAsp.net so bare with me. Is it possible to setup the root web.config file to allow directories off the root to hold logical groupings of pages? Can these pages then access code in the bin folder off the root and the root web.config file settings? Do you always have to setup an application off the root to allow subdirectories to access a central bin folder in the application? At my previous domain host they did not give me the ability to setup an Application directory. The only one that I know of was the root. In their setup, I as able to create directories off the root for logical groupings of pages and have a central bin folder to hold distributed code that all of the pages used. When I setup a directory on the domain at discountAsp.net and try to access pages within a directory off the root I get the: 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. As I understand it, when you setup an application it is a web site unto its self. With this comes better control of the application pool and an Isolation that is very beneficial. It also means that each application has its own web.config file which is where my connection string for the common database is. If I want to roll the password for the database in my current setup I have to go into each web.config file. Thanks for any help!
...At DASP your site is in it's own pool. The root of your site is an Application. You can set any other folder as an Application via the Control Panel. It may work via code but I haven't tired. ;-) As for the /bin/ folder, there is inheritance throughout the entire site but you can override that via code, and of course each folder can have it's own web.config too. I guess I answered that my own way but it should cover the bases. ;-) All the best, Mark
Vrtual directory not being configured as an application Thanks so much for the reply. If the root is an application why do I get the following error when adding a directory off the root and trying to run an aspx page in it? 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. I thought any directory off the root of an application would be able to run a page and use the application root web.config file. Do I have somthing wrong in my root web.config file? For example: MyDomain.com/test1.aspx = Works fine MyDomain.com/Directory1/test2.aspx = Parser Error Message
Hi, We have physical directories at DASP, not virtual. (A good thing.) As for Machine level changes, we do have access to some settings but I'm not sure about MachineToApplication. Send an Email to the DASP support: [email protected] Please repost when you get a response. ;-) All the best, Mark P.S. I need to test a lot more settings with the IIS7 Manager, DASP gives us a lot of freedom with that. UPDATE: Just checked the web.config I'm running here on IIS7 and this is the MachineToApplication section I'm using right now: <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections>
Thanks a bunch for the reply! I found that I had some missing statements in my configSections and you pointed me in the right direction.