Asp.net MVC应用程序中的虚拟目录应用程序 [英] Virtual Directory App within a Asp.net MVC app

查看:190
本文介绍了Asp.net MVC应用程序中的虚拟目录应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试在当前域中将Screwturn Wiki托管为虚拟目录应用程序时遇到问题.

I am having issues trying to host screwturn wiki as a virtual directory application within my current domain.

该域托管为something.com,而Wiki看起来就像something.com/wiki

the domain is hosted as something.com and the wiki would look like something.com/wiki

当我浏览至something.com/wiki时

when i browse to something.com/wiki I get

无法加载文件或程序集 'System.Web.Mvc,版本= 1.0.0.0, 文化=中立, PublicKeyToken = 31bf3856ad364e35'或 它的依赖项之一.系统 找不到指定的文件.

Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

为什么虚拟目录回退到根应用程序.应该不是它自己的应用程序边界吗?

Why is the virtual directory falling back to the root application. Shouldn't it be its own application boundary?

我还添加了根mvc应用程序

I have also added to the root mvc app

routes.IgnoreRoute("{*path}", new { path = @"wiki\/(.*)" });

这仍然没有解决问题.

推荐答案

找到了解决方案.

感谢Rick Strahls博客 http://www.west-wind. com/Weblog/posts/133041.aspx

Thanks to Rick Strahls blog http://www.west-wind.com/Weblog/posts/133041.aspx

解决方案非常简单.将以下内容添加到您的Web应用程序中

The solution was rather simple. Add the below to your too web application

<location inheritInChildApplications="false">
    <system.web>   
    .........
    </system>
</location>

这解决了我的问题.

这篇关于Asp.net MVC应用程序中的虚拟目录应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆