Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dom 6 posts 27 karma points
    Jul 24, 2012 @ 16:24
    Dom
    0

    4.0.2.1: Error at \umbraco\presentation\default.aspx.cs: 68

    Received an already built site and have a Visual Studio 2008 solution, which compiles fine. Just need to get Umbraco running on IIS7, running on Windows Server 2008 R2 64-bit. Site configured for ASP.NET 2.0. Deployed the "presentation" folder to the IIS directory.

    Got the following after typing in the url in attempt to browse the site:

    Can someone please shed some insight into this error?

  • Richard Terris 273 posts 715 karma points
    Jul 26, 2012 @ 13:26
    Richard Terris
    0

    Since it's running on .NET 2.0, I presume you've checked the application pool for that site is also 2.0?

    Sometimes it's the simple things that get you stumped.

    Let me know, and if not I'll see what else I can suggest

  • Dom 6 posts 27 karma points
    Jul 26, 2012 @ 13:30
    Dom
    0

    Yes, the application pool is 2.0, with Enable 32-Bit applications set to False.

    Identity is NetworkService.

  • Richard Terris 273 posts 715 karma points
    Jul 26, 2012 @ 13:48
    Richard Terris
    0

    Hi Dom

    Can you copy the full stack trace to here? The error isn't descriptive enough.

    Thanks,

    Richard

  • Dom 6 posts 27 karma points
    Jul 26, 2012 @ 14:35
    Dom
    0

     

    [NullReferenceException: Object reference not set to an instance of an object.]
       umbraco.UmbracoDefault.Page_PreInit(Object sender, EventArgs e) in Cxx\Umbraco\umbraco\presentation\default.aspx.cs:68
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Page.OnPreInit(EventArgs e) +8719934
       System.Web.UI.Page.PerformPreInit() +31
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282

     

  • Richard Terris 273 posts 715 karma points
    Jul 26, 2012 @ 14:42
    Richard Terris
    0

    Dom

    Can you also post the code from default.aspx.cs ?

  • Dom 6 posts 27 karma points
    Jul 26, 2012 @ 14:47
    Dom
    0

    This is the event handler where the problem occurs. The bit in bold is line 68.

    void Page_PreInit(Object sender, EventArgs e)
            {
                Trace.Write("umbracoInit", "handling request");

                bool editMode = UmbracoContext.Current.LiveEditingContext.Enabled;

                if (editMode)
                    ValidateRequest = false;

                if (m_tmp != "" && Request["umbPageID"] == null)
                {
                    // Check numeric
                    string tryIntParse = m_tmp.Replace("/", "").Replace(".aspx", string.Empty);
                    int result;
                    if (int.TryParse(tryIntParse, out result))
                    {
                        m_tmp = m_tmp.Replace(".aspx", string.Empty);

                        // Check for request
                        if (!string.IsNullOrEmpty(Request["umbVersion"]))
                        {
                            // Security check
                            BasePages.UmbracoEnsuredPage bp = new BasePages.UmbracoEnsuredPage();
                            bp.ensureContext();
                            m_version = new Guid(Request["umbVersion"]);
                        }
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(Request["umbPageID"]))
                    {       
                        int result;
                        if (int.TryParse(Request["umbPageID"], out result))
                        {
                            m_tmp = Request["umbPageID"];
                        }
                    }
                }

                if (m_version != Guid.Empty)
                {
                    HttpContext.Current.Items["pageID"] = m_tmp.Replace("/", "");
                    m_umbPage = new page(int.Parse(m_tmp.Replace("/", "")), m_version);
                }
                else
                {
                  

                    m_umbRequest = new requestHandler(content.Instance.XmlContent, m_tmp);
                    Trace.Write("umbracoInit", "Done handling request");
                    if (m_umbRequest.currentPage != null)
                    {
                        HttpContext.Current.Items["pageID"] = m_umbRequest.currentPage.Attributes.GetNamedItem("id").Value;

                        // Handle edit
                        if (editMode)
                        {
                            Document d = new Document(int.Parse(m_umbRequest.currentPage.Attributes.GetNamedItem("id").Value));
                            m_umbPage = new page(d.Id, d.Version);
                        }
                        else
                            m_umbPage = new page(m_umbRequest.currentPage);
                    }
                }

                // set the friendly path so it's used by forms
                HttpContext.Current.RewritePath(HttpContext.Current.Items[requestModule.ORIGINAL_URL_CXT_KEY].ToString());

                if (UmbracoSettings.UseAspNetMasterPages)
                {
                    if (m_umbPage != null)
                        this.MasterPageFile = template.GetMasterPageName(m_umbPage.Template);

                    initUmbracoPage();
                }
            }

  • Richard Terris 273 posts 715 karma points
    Jul 27, 2012 @ 12:22
    Richard Terris
    0

    Hi Dom

    I have to be honest and say I don't know what's causing that.

    I've tweeted out a link to see if anyone else in the community can help you.

    Richard

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 27, 2012 @ 12:51
    Sebastiaan Janssen
    0

    First of all: make sure the network service has the appropriate modify permissions.

    Second: does your site run on your local IIS? Check the settings for both environments, make sure they match.

    Third: if all else fails, try to check (double check) that you've configured everything correctly, download the "vista" guide from the release page and see if you've missed something. http://umbraco.codeplex.com/releases/view/37337

    You might want to consider upgrading to the .net 3.5 web.config as well, that one always seemed to work better for me. 

    Get the config file here: https://dl.dropbox.com/u/3006713/aspnet35.config, merge in the changes to your existing web.config file (using winmerge for example), rename this file to web.config and replace your existing web.config (and change your application pool to use integrate pipeline / .net 3.5 of course).

  • Dom 6 posts 27 karma points
    Jul 31, 2012 @ 18:23
    Dom
    1

    The site runs on the Visual Studio development server and the default page loads ok. Web.config on the testing server is from Visual Studio.

    However, changing IIS 7 on the testing server to run in Classic rather than Integrated mode has solved the problem.

  • Dom 6 posts 27 karma points
    Aug 01, 2012 @ 11:49
    Dom
    0

    Even after merging the web.config I had with the aspnet35.config file, still got the error. Running IIS 7 in Classic mode works. Just one question: is anyone aware of an issue with this?

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Aug 01, 2012 @ 11:50
    Sebastiaan Janssen
    0

    Nope, classic mode should be just fine, not to worry.

Please Sign in or register to post replies

Write your reply to:

Draft