2015-01-10 74 views
3

我创建了Umbraco 7 MVC站点并将其部署到IIS。所以这个URL就像例如:www.mydomain.com。 在一个子目录中,我托管了一个单独的MVC网站。因此该网址可以是:www.mydomain.com/MVCApplication。在IIS中托管使用​​MVC站点的Umbraco站点

当我试图访问子应用程序URL;它给出

Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 

因此,我将此dll添加到我的bin文件夹,这是在子目录中。然后它会提示另一个错误

Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified. 

看起来子应用程序试图读取根文件夹DLL或根web.config。 Umbraco网站工作正常。当我删除umbraco网站时,子应用程序工作。请任何想法吗?

回答

2

最后,这里是解决方案。必须在以下代码片段中将<System.web><system.webServer>包装在父网站web.config文件中。这不是参考文献的问题。它继承了子Web应用程序中的父级web.config文件:

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

希望这也能帮助别人。

0

您可以添加以下行到你的web.config

<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 

这应该去进入编辑>装配部分。

<compilation> 
    <assemblies> 
    </assemblies> 
</compilation> 

你能还保证“UrlRewritingNet.UrlRewriter” DLL已经被正确的子应用refenced?你也可以尝试设置引用“复制本地”属性为TRUE。您可以通过选择特定参考并按F4调出Proerties窗格来查看这些属性。

Regards