Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

I have an application that uses MVC 5, Web API 2, and Angular and I'm having some trouble getting it to work properly. I am using the default MVC routing to initially load the shared layout page, and I'm then using the angular routing to essentially have a single page application. The error I'm getting is the identity impersonate error. (below)

HTTP Error 500.24 - Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Most likely causes:
system.web/identity@impersonate is set to true. 

I have set the identity impersonate to false, still did not work. I also added the line below to the config file, still did not work.

<validation validateIntegratedModeConfiguration="false" />

Here is my Application Start method:

protected void Application_Start()
    {
        GlobalConfiguration.Configure(WebApiConfig.Register);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }

Here is my route config

public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
    }

There is a second part to my question that may be related to the issues I'm facing. I have the application under the default web site in a subfolder (I navigate to server.com/appName). I can get to the home page, but clicking on any links presents the error mentioned above.

Any ideas? Let me know if more code is needed.

share|improve this question

1 Answer 1

I have the application under the default web site in a subfolder (I navigate to server.com/appName).

You need to run ASP.NET (or MVC) inside of an IIS application for it to function. It won't function correctly from a subdirectory of an application.

In Internet Information Services Manager, navigate to the virtual directory, right click it and choose "Add Application". Enter a name, application pool, and the physical path, then click on "OK".

share|improve this answer
    
I may have just poorly described what I am doing here. When I originally created the web application, it appeared as a normal folder under the DefaultWebSite and I then converted it to an application and assigned it an application pool. Is this the same as what you described? –  Busch_League 2 days ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.