- Right-click your application virtual directory on inetmgr.exe.
- Properties->Virtual Directory Tab-> Configuration.
- Add a new mapping extension. The extension should be .*,which will be
mapped to the Executable
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,
or the appropriate location on your
computer (you can simply copy this
from the mapping for .aspx files). On
the mapping uncheck “check that file
exists”.- 3 X OK and you’re good to go.
- If you want,you can apply this setting to all your web sites. In
step1,click on the “Default Web Site”
node instead of your own virtual
directory,and in step 2 go to the
“Home Directory” tab. The rest is the
same.
看起来有点黑客通过ASP.NET路由一切。
编辑MVC路由以在URL中包含.mvc,然后按照基于此扩展的解决方案1中的步骤。修改:原始图片链接已丢失,但此处是来自Google的缓存:
解决方法
If *.mvc extension is not registered
to the hosting,it will give 404
exception. The working way of hosting
MVC apps in that case is to modify
global.asax routing caluse in the
following way.routes.Add(new
Route(“{controller}.mvc.aspx/{action}”,
new MvcRouteHandler()) {
Defaults = new RouteValueDictionary (new{ controller
= “YourController”} ) });In this way all your controller request will end up in *.mvc.aspx,which is recognized by your hosting. And as the MVC dlls are copied into your local bin,no special setttings need to be done for it.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。