Mvc Deployment

With Mvc, we need IIS pass all visits to our application. There are 2 ways to deploy Mvc web site.

1st

The first one is set Web.config:

<Leafing.Settings>
  <add key="MvcPostfix" value=".aspx" />
</Leafing.Settings>

By this mode, all URL will have a postfix of ".aspx". This will let IIS pass all visits to our application. The URL is such as:

http://localhost/appname/book/list.aspx
http://localhost/appname/book/edit/1.aspx

Attention that the URL in our views should be generated by "UrlTo" or "LinkTo" so that the postfix will dependent by the configuration. This method still need IIS setting of aspx that "Verify that file exists" be unchecked. The value of MvcPostfix could be ".html" either, but don't forget to remove ".html" from HttpHandler of web.config and set IIS to pass all html requests to us.

2nd

The second way is set IIS.
For IIS 5.x:
  • Open IIS, navigate to our web site.
  • Open the web site property dialog.
  • In "Virtual Directory" panel, click "Configuration..." button.
  • In "Mapping" panel, click "Add" button.
  • In "Executable File" input the ASP.NET ISAPI DLL path such as "c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll". You can copy it from ".aspx" if you don’t know what it is.
  • In textbox "Extend Name", input "*" in it.
  • Select "All actions" radio box.
  • Uncheck "Verify that file exists" check box.
  • And then, click "OK".
For IIS 6.x:
  • Open IIS, navigate to our web site.
  • Open the web site property dialog.
  • In "Virtual Directory" panel, click "Configuration..." button.
  • Under Wildcard application maps, click Insert (not Add)
  • Input the ASP.NET ISAPI DLL path such as "c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll". You can copy it from ".aspx" if you don’t know what it is.
  • Uncheck Verify that file exists check box.
  • And then, click "OK".
These steps will let IIS pass all visits to our application too. But it need we have the permission to set IIS. By this way the URL will more clear than the 1st way. So I recommanded it if we have the permission.

Last edited Apr 9, 2014 at 2:26 PM by lifeng, version 8

Comments

No comments yet.