简体   繁体   中英

IIS website project as MVC project

I built a MVC 5 application and all is good. I want to create a new site on my local IIS and keep working on this project as a website and not as IIS project (I have my reasons), so I created a new website and copied all the MVC app files in to his folder.

The site is working fine, but I lost the MVC behavior.

Let's say I'am adding this action

public ActionResult D()
{
    return View();
}

When I click on this @Html.ActionLink("d","D") I am getting an 404 error, plus I dont have the MVC options any more. For example, when I right-click on the controller I don't have the "add view" option.

Is there a way to work on a website and keep the MVC features?

You shouldent make a copy of your code to the iis. What you need to do is to setup your project settings to use iis express (your local iis). Thats what you are looking for. So that means that everytime you run your site from visual studio, it actually runs from iis, and you can continu to work as usual.

Try to do step two in this post http://robrich.org/archive/2012/06/04/moving-to-iis-express-and-https.aspx

Cant get that to work you can google: setup visual studio 2012 with iis

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM