开发者

ASP.NET MVC deploy: how to run the app?

I have written a little bog standard asp.net mvc3 app in vs web express - works great, so now I want to put it on the iis 7 server I installed on a win2k8 r2 box - I haven't done anything with the install other than t install the web deploy 2 package as well. It works ok when I go to the site in a browser I get the welcome to IIS7 page.

In vse I have clicked on "publish..." menu.

Entered the address of my w2k8 box entered the "Default Site/MvcApplication1". Checked IIS Application. Entered my admin user name password for the host.

Pressed the Publish button and it went away and then finished telling me everything worked ok.

What do I type into the browser address bar to run the app? Nothing seems to work. I can see all the relevant files in the wwwroot directory and I have given every conceivable user full access to that directory.

if I type http://machinename/Mv开发者_C百科cApplication1 in I just get a directory listing (in the browser)

if I type http://machinename/MvcApplication1/Home/Index - i get a 404 file/directory not found.

Nothing I type will fire up the default page for the app. What have I missed?


You should check what the GalacticCowboy is suggesting, and for a sake of testing add an ordinary .aspx page in a root of your site say test.aspx, have it render 'Hello world' message, and try to see that. If you can't see it, it is up to the IIS settings, then do what the GalacticCowboy is suggesting.

If you can see the test page, then this means that something connected to MVC routing engine is missing. The first thing to check is if the 'bin' folder contains the following files:

  • Microsoft.Web.Infrastructure
  • System.Web.Abstractions
  • System.Web.Helpers
  • System.Web.Mvc
  • System.Web.Razor
  • System.Web.WebPages
  • System.Web.WebPages.Deployment
  • System.Web.WebPages.Razor

You may not need all of them, don't know if you're using Razor or not.


There is a possibility that your database file is read-only... You should give the IIS user the rights to Read/Write/Modify the file.

Also I have some pretty nasty experiences with the publish function from Visual Studio, the best option is to publish your site manually.


In IIS, make sure that the folder is configured as a web application and not a virtual directory.

Open IIS Manager and drill down to the application level. If it has a "folder" icon, it's a virtual directory. If it's a web application, it will have an icon that's like a globe + a white rectangle. (piece of paper?)

If it's a virtual directory, right-click on it and choose "Convert to Application".


Go into IIS, switch to content view and try to browse to the index page from there. You may just have a path Issue.


!) Make sure you either have mvc 3 installed on the server.

2) Make sure you have .net 4.0 installed on the server.
Follow the instructions on the answer ASP.NET MVC on IIS 7.5


Try this url http://machinename/ or check in bindings, what port no you have specified. Try changing it from default to something random like 83 and try http://machinename:83/. Alternatively try to ping the server and ensure that it is reachable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜