Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7592343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:52:58+00:00 2026-05-30T20:52:58+00:00

During development of an mvc web application, I’m encourtering issues running the local instance

  • 0

During development of an mvc web application, I’m encourtering issues running the local instance of the site. When I try to reload a page, after a successful first load, I’m seeing the below error. If I run the site through the VS virtual server, there are no issues. My app pool is running in integrated mode and it is running .net 4. Any idea why this is occurring? Is this enough information?

[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.HttpServerVarsCollection.Get(String name) +109
System.Web.Mvc.UrlRewriterHelper.WasThisRequestRewritten(HttpContextBase httpContext) +59
System.Web.Mvc.PathHelpers.GenerateClientUrlInternal(HttpContextBase httpContext, String contentPath) +213
System.Web.Mvc.PathHelpers.GenerateClientUrlInternal(HttpContextBase httpContext, String contentPath) +168
System.Web.Mvc.PathHelpers.GenerateClientUrl(HttpContextBase httpContext, String contentPath) +148
LeadManager.Web.UI.Helpers.MenuHelper.GenerateUrl(String url) in C:\Development\Hg\LeadManager\Web.UI\Helpers\MenuHelper.cs:1132
LeadManager.Web.UI.Helpers.MenuHelper.BuildLeadManagementMenu(Menu navMenu, Agent agent) in C:\Development\Hg\LeadManager\Web.UI\Helpers\MenuHelper.cs:554
LeadManager.Web.UI.Helpers.MenuHelper.AddNavMenu(Agent agent) in C:\Development\Hg\LeadManager\Web.UI\Helpers\MenuHelper.cs:530
ASP._Page_Views_Shared__Layout_cshtml.Execute() in c:\Development\Hg\LeadManager\Web\Views\Shared_Layout.cshtml:115
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +279
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +103
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +172
System.Web.WebPages.WebPageBase.Write(HelperResult result) +88
System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action1 body) +233
System.Web.WebPages.WebPageBase.PopContext() +233
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +377
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +32
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +748196
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) +748196
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList
1 filters, ActionResult actionResult) +265
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +748160
System.Web.Mvc.Controller.ExecuteCore() +159
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +334
System.Web.Mvc.<>c_DisplayClassb.b_5() +62
System.Web.Mvc.Async.<>c_DisplayClass1.b_0() +15
System.Web.Mvc.<>c_DisplayClasse.b_d() +52
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +437
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +354

MenuHelper is used to build navigation menus. The code that fails is the return statement outside of the if:

private static string GenerateUrl(string url)
{
    if (instance == null)
    {
        // hack to enable using this on old web forms pages
        return UrlHelper.GenerateContentUrl(url, new HttpContextWrapper(HttpContext.Current));
    }
    return (new UrlHelper(instance.htmlHelper.ViewContext.RequestContext)).Content(url);
}

private static string GenerateUrl(string actionName, string controllerName)
{
    if (instance == null)
    {
        // hack to enable using this on old web forms pages
        return GenerateUrl(String.Format("{0}/{1}", controllerName, actionName));
    }

    if (instance.htmlHelper == null)
        throw new InvalidOperationException("htmlHelper has not been populated.");
    if (instance.htmlHelper.ViewContext == null)
        throw new InvalidOperationException("ViewContext has not been populated.");
    if (instance.htmlHelper.ViewContext.RequestContext == null)
        throw new InvalidOperationException("RequestContext has not been populated.");

    UrlHelper urlHelper = new UrlHelper(instance.htmlHelper.ViewContext.RequestContext);
    if (urlHelper == null)
        throw new InvalidOperationException("UrlHelper has not been populated.");

    if (String.IsNullOrEmpty(actionName))
        throw new InvalidOperationException("actionName has not been populated.");
    if (String.IsNullOrEmpty(controllerName))
        throw new InvalidOperationException("controllerName has not been populated.");

    return (urlHelper.Action(actionName, controllerName));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:53:00+00:00Added an answer on May 30, 2026 at 8:53 pm

    I found the issue, it was the IIS7 URL Rewrite Module. I’m not sure why or how but I solved the problem by uninstalling it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

During development, i can easily manage my users/roles/smtp etc using the Administer Web Site
My new ASP.NET MVC Web Application works on my development workstation, but does not
During development, I usually test ASP.Net applications using the Web Development Server (sometimes called
During software development, there may be bugs in the codebase which are known issues.
I am developping a web application by using the ASP .NET MVC 3 framework.
During development i find my self often having to restart my application which in
(apologies for the somewhat lengthy intro) During development of an application which prefaults an
I am having trouble running my asp.net mvc 2 app. using VS2010 ASP.NET Development
I have been using the Grails database-migration plugin during development of my application, and
Scenario I develop an MVC application that will be hosted in Windows Azure. During

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.