在IIS中使用MVC站点托管Umbraco站点

时间:2015-01-10 20:43:27

标签: c# asp.net-mvc iis umbraco7

我创建了Umbraco 7 MVC站点并将其部署到IIS。所以URL就像例如:www.mydomain.com。 在子目录中,我已经托管了一个单独的MVC网站。所以URL如下:www.mydomain.com/MVCApplication。

当我尝试访问子应用程序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或root web.config。 Umbraco网站工作正常。当我删除umbraco网站时,子应用程序工作。好吗?

3 个答案:

答案 0 :(得分:2)

最后这是解决方案。不得不将<System.web><system.webServer>与以下代码段包装在父网站web.config文件中。这不是引用的问题。它继承了子Web应用程序中的父web.config文件:

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

希望这也可以帮助其他人。

答案 1 :(得分:1)

为了禁用umbraco继承,请尝试在webconfig中将<system.webserver><system.web><location path="." inheritInChildApplications="false">一起包装

http://www.experts-exchange.com/Networking/Misc/Q_26535962.html

答案 2 :(得分:0)

您可以在web.config

中添加以下行吗?
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

这应该进入Compilations&gt;装配部分。

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

你能否确保&#34; UrlRewritingNet.UrlRewriter&#34; dll已在子应用程序中正确重新生成?您也可以尝试设置引用&#39;复制本地&#39;属性为TRUE。您可以通过选择特定参考并按F4以显示Proerties窗格来查看这些属性。

此致