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 6033627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:30:38+00:00 2026-05-23T05:30:38+00:00

Is it possible to run an MVC application from a virtual directory in IIS7?

  • 0

Is it possible to run an MVC application from a virtual directory in IIS7? I have built an open source utility app in ASP.NET MVC3 and wondering if that was a mistake; it likely is if the site cannot be run from a virtual directory.

Take a simple default route of /home/index if running from a virtual directory named /app, will actually be /app/home index. Which kind of messes things up for routing.

I don’t want a user to have to change routes and recompile the project to use the app in a virtual directory. Is there a way to change a configuration parameter to indicate what the root folder of what the application is?

  • 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-23T05:30:38+00:00Added an answer on May 23, 2026 at 5:30 am

    Is it possible to run an MVC application from a virtual directory in IIS7?

    Not only that it is possible but it is the preferred way.

    Which kind of messes things up for routing.

    Not if you use Html helpers when dealing with urls which will take care of this.

    Here’s a typical example of what you should never do:

    <script type="text/javascript">
        $.ajax({
            url: '/home/index'
        });
    </script>
    

    and here’s how this should be done:

    <script type="text/javascript">
        $.ajax({
            url: '@Url.Action("index", "home")'
        });
    </script>
    

    Here’s another typical example of something that you should never do:

    <a href="/home/index">Foo</a>
    

    and here’s how this should be written:

    @Html.ActionLink("Foo", "Index", "Home")
    

    Here’s another example of something that you should never do:

    <form action="/home/index" method="opst">
    
    </form>
    

    and here’s how this should be written:

    @using (Html.BeginForm("Index", "Home"))
    {
    
    }
    

    I think you get the point.

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

Sidebar

Related Questions

I have built an ASP.NET MVC 3 web application (with exlusively Razor/cshtml pages) that
I have heard that you can run an ASP.NET application and ASP.NET mvc application
Is it possible to run the new ASP.NET MVC 2 Preview 2 on mono?
I have an ASP.NET MVC application for which I store uploaded content files in
From Entity Framework using ASP .NET MVC 3.0, is it possible to use a
I'm evaluating a migration from a classic ASP 3.0 application to ASP.NET MVC. I've
In a java web application (servlets/spring mvc), using tomcat, is it possible to run
is it possible to run spring mvc application on tomcat(with this plugin http://mojo.codehaus.org/tomcat-maven-plugin/ )
I have an ASP.NET MVC 3 app that is using SQL Server CE 4.0
I have an ASP.NET MVC web app used to monitor the state of my

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.