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



我创建了 Umbraco 7 MVC 站点并将其部署到 IIS。所以网址是这样的,例如:www.mydomain.com。在一个子目录中,我托管了一个单独的MVC网站。所以网址是例如: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 或根 web.config。本布拉科网站工作正常。当我删除本布拉科网站时,子应用程序有效。请问有什么想法吗?

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

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

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

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

希望这也对其他人有所帮助。

你能把

下面一行添加到你的web.config中吗

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

这应该进入汇编>程序集部分。

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

您能否确保"UrlRewriteNet.UrlRewriter"dll已在子应用程序中正确重新围栏?您也可以尝试将引用"复制本地"属性设置为 TRUE。可以通过选择特定引用并按 F4 调出"Proerties"窗格来查看这些属性。

问候

最新更新