Error after logging in on all pages of dashboard

Topics: ASP.NET 2.0, Business Logic Layer, Controls
Jun 19, 2013 at 9:27 PM
Hello,
I just installed blogengine on a site on our production server. I log in as admin and when I go to the users tab or any other tab I get the following error:

Ooops! An unexpected error has occurred.


This one's down to me! Please accept my apologies for this - I'll see to it that the developer responsible for this happening is given 20 lashes (but only after he or she has fixed this problem).


Error Details:

Url : http://www.natlassm.com/blog/admin/Posts/Posts.aspx

Raw Url : /blog/admin/Posts/Posts.aspx

Message : Exception of type 'System.Web.HttpUnhandledException' was thrown.

Source : System.Web

StackTrace : at System.Web.UI.Page.HandleError(Exception e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest()

at System.Web.UI.Page.ProcessRequest(HttpContext context)

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

TargetSite : Boolean HandleError(System.Exception)

Message : The Controls collection cannot be modified because the control contains code blocks (i.e. ).

Source : System.Web

StackTrace : at System.Web.UI.ControlCollection.Add(Control child)

at System.Web.UI.PageTheme.SetStyleSheet()

at System.Web.UI.Page.OnInit(EventArgs e)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

TargetSite : Void Add(System.Web.UI.Control)

Would anyone know what I need to do to correct this issue?
Regards,
Irvin
Coordinator
Jun 19, 2013 at 9:37 PM
Did you modify anything in the admin? This usually happens when you try to use server-side tags (<%%>) inside page header, for custom scripts for example.
Jun 20, 2013 at 12:19 PM
Me and the network admin commented some lines of code in the web config files, not on any of the pages. We commented some lines of code b/c we were getting errors of duplicate "ScriptHandler" and something else.
Coordinator
Jun 20, 2013 at 3:07 PM
If you running blog as child application under parent site, you need to use "inheritInChildApplications=false" in parent app's web.config to get rid of those errors instead of commenting them out.
Jun 20, 2013 at 5:12 PM
I changed the application pool to 2.0 framework on the parent site. I also uncommented the code in the webconfig of the parent site and it errors out with a 500 Internanl server error. I placed the inheritChildApplications here:



<location path="." inheritInChildApplications="false">
<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>
</location>


When I do this the parent site errors out and the child application is getting 500 - Internal Error but I'm guessing it's because I set the framework to 2.0.
Please let me know what you think I should do.
Thanks for all your help!
Coordinator
Jun 20, 2013 at 5:48 PM
Try to read this.
Jun 20, 2013 at 6:49 PM
I appreciate all the help. Let me take a look at the article and play around with it. Question....if I changed the parent site to use 4.0 framework then I can avoid the compatibility issues...correct?
Thanks again.
Coordinator
Jun 20, 2013 at 7:02 PM
You still might need to turn config inheritance off in some cases, when something registered in parent web.config not expected in the child app.
Jun 20, 2013 at 7:45 PM
I moved the config section to the root like the article stated from the parent webconfig --> root webconfig under the framework directory on the C:\ drive. So the parent site is set to 2.0 framework in the application pool and the blog is set to 4.0 framework. But I still get the same error that I mentioned in my first post. I log in to the blog. Click on users or any of the other tabs and then get the OOps message......