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

  • SEARCH
  • Home
  • 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 7679091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:47:48+00:00 2026-05-31T17:47:48+00:00

I have an ASP.NET MVC 3 application (in IIS 7.5) with a portable area.

  • 0

I have an ASP.NET MVC 3 application (in IIS 7.5) with a portable area. When I host the application consuming the portable area in a web site my routing works perfectly e.g.

http://localhost:9001/Clearance/Home/Search (this works)

However, when hosting in a virtual directory e.g.

http://localhost/Acme.Risks.Clearance.Web.Area.TestUI/Clearance/Home/Search (this does not work)

I get the following error:

Multiple types were found that match the controller named ‘Home’. This can happen if the route that services this request (‘Clearance/{controller}/{action}’) does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the ‘MapRoute’ method that takes a ‘namespaces’ parameter.

I don’t understand why, I am specifying namespaces it works fine when running in a web site.

Here is my portable area registration:

    public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
    {
        if (context == null)
        {
            throw new ArgumentNullException("context");
        }

        base.RegisterArea(context, bus);
        context.MapRoute(
            RouteName.ClearanceAreaDefault, 
            this.AreaName + "/{controller}/{action}/{id}", 
            new { controller = "Home", action = "Search", id = UrlParameter.Optional },
            new[] { typeof(HomeController).Namespace });
    }

Here is the Global.asax for the web application in a virtual directory (does not work):

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.MapRoute(
            "Default",
            "{controller}/{action}/{id}",
            new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            new[] { typeof(HomeController).Namespace });
    }

Here is the Global.asax for the web application in a web site (does work):

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.MapRoute(
            "Default",
            "{controller}/{action}/{id}",
            new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            new[] { "Acme.Risks.Web.UI.Controllers" });
    }

I have used Phil Haack’s “RouteDebugger” (http://nuget.org/packages/routedebugger) and the route debug information on both requests is identical.

Does anyone know why this is happening?

Thanks,

Callum

  • 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-31T17:47:49+00:00Added an answer on May 31, 2026 at 5:47 pm

    This was down to the namespace used in the data context for MVC.

    My web area assembly is “Acme.Risks.Clearance.Web.Area”.

    My web site assembly is “Acme.Risks.Web.UI” (working).

    My web area test UI assembly is “Acme.Risks.Clearance.Web.Area.TestUI” (not working).

    The namespace used in the data context was “Acme.Risks.Clearance.Web.Area*”, so in the case of the web area test UI the wildcard caused two matches. So even though the routing information was identical, ASP.NET MVC could not decide which was the right assembly because there were duplicate matches.

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

Sidebar

Related Questions

I have asp.net mvc 4 web application project on my server in IIS Directory.
I have an Asp.Net MVC application that works in the vs.net development web server.
I have an ASP.NET MVC web application running in IIS as a subweb; let's
I have an Asp.Net MVC 2 web application deployed on IIS 7.5 on .Net
I have an ASP.NET MVC 3 Beta application running on IIS. In my web.config
I have an ASP.NET 4.0 MVC web application running on IIS 6.0 with a
I have an ASP .Net MVC 3.0 web application hosted on IIS and I
I have a ASP.NET MVC application that runs in both IIS 6 and 7.
I have created an multi thread application on IIS (ASP.NET MVC), When the threading
i have published asp.net mvc application on iis 6 on the server(windows server 2003)

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.